This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Setting selected node of a rich:tree dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Setting selected node of a rich:tree dynamically" Watch "Setting selected node of a rich:tree dynamically" New topic
Author

Setting selected node of a rich:tree dynamically

zul' Zorander
Greenhorn

Joined: Aug 12, 2009
Posts: 21
Is there any way to set selected node of a rich tree dynamically based on a action event??
I have a boolean checkbox enclosed within a tree node and i need to set selected tree node based on checkbox selection. I tried using advisenodeselected but that didnt give correct functionality. I tried triggering click event on tree on checkbox selection and tried to set advicenodeselected on tree click. But the problem I am facing is the node above or below the desired node is getting selected. From what I understand is that the method binding to advisenodeselected executes once for each node and based on return value the node is selected.
But for the click the method is called number of nodes+1 times. I am thinking that the tree needs to deselect the selected node before selecting a new node. But the problem I am facing is the for the tree click the method is executing number of nodes times some times and +1 some time leading to the above or below node the desired node to be selected.
Please explain the reason behind this

Thanks
Zeddicus
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959
    
  19

No, you can have multiple nodes open at the same time.

What you need is to provide the "node displayed" method on the server and let it instruct the client whether a given node is open or not. It gets called for each node that might display itself or its children.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting selected node of a rich:tree dynamically
 
Similar Threads
I could not expand myfaces tree
multiple node selection in jtree
jsf tree with checkbox
JTree Vertically half displayed problem
How do you implement Tomahawk tree control with a CheckBox?