Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
530
in expanding a node as result of mouse click it is calling getGroups(aHtmlTreeView ) instead of getGroups(aHtmlTreeNode)
posted

Hi

 I am trying to figure out your tree view component. I have installed your demo and I am able to run tree view recursive data example in my RAD.

 

I am trying to create a tree to display groups, subgroups which are instances of group objects too, and reports. Just to start simple I am right now just trying to display onlu group and sub groups.

So the getGroups(aHtmlTreeView ) is adding the template and returing arraylist having 2 group objects, represesnting public and private. Each group has sub groups which is arraylist of groups.

After getGroups(aHtmlTreeView ) , the getGroups(aHtmlTreeNode) is executed. This method is also adding template and actually returning the subgroups from group represented by the dataKeyValue.

So for each group and sub group the getGroups(aHtmlTreeNode)  gets executed.

page displays and initially displays Public and Private as fodler title as expected. But when I click on any of these two the control goes back and executes getGroups(aHtmlTreeView ) , as child count is greater then and condition set only array list containing initial two groups is returned from this method. This time the getGroups(aHtmlTreeNode) doesn't gets called at all.

When I compare this with your demo example, second time i.e. when a node is clicked only getGroups(aHtmlTreeNode) gets executed for all the sub nodes and getGroups(aHtmlTreeNode) deson't get executed.

 I have compared the both files and couldn't see a logical difference as such that can tell why there is above said difference in the two. Just thought to ask if you can take a guess what can potentially cause this?

Your example and my code both have bean scope set to 'request'.

  • 530
    posted

    I figured this out. When we click on the plus sign it expands and hence in back ground it calls the get method with node as parameter. When we click on the text itself it actually selects the node and calls the get method with tree as parameter.