Calling a javascript function in JSP page inside a DATA View

My application has a tree and a data view each cell in data view has JSP page holding a embeded graphics.

on click on the tree the graphics are displayed in each cell of dataview by calling the javascripts functions inside the JSP page.

The problem is the data view refreshes when I click the nodes of the tree.
How can I call the java scripts function in the JSP page inside cells of data view without refreshing the data view page.

Your help will be appreciated.

Thank you,

DataView was not purposed for such use-case. The correct scenario will be loading of some static data from server side only, and moving all js logic to the template of dataview.