This content has been marked as final.
Show 3 replies
-
1. Re: Rich Tree Expand node
ahoehma Oct 15, 2009 11:42 AM (in response to mattc1)Hmmm ... I think this is (currently) not possible.
For such client side code the whole tree have to stay on the client (switchType="client").
Please describe more details. What do you want to do? -
2. Re: Rich Tree Expand node
mattc1 Oct 15, 2009 11:49 AM (in response to mattc1)We have a tree with multiple node types. Some nodes we want to toggle on click but not select the node and other nodes we only want to toggle by clicking the arrow. Basically some nodes we want to behave as if the expand arrow is clicked when the node text is clicked.
I came up with this scriptfunction setNodeToggle(e) { var elt = Event.element(e); var treeItem = Tree.Item.findComponent(elt); if (treeItem.isCollapsed()) treeItem.expand(); else treeItem.collapse(); }
That gets called by changing my rich:treeNode to<rich:treeNode type="contactfolder" onclick="setNodeToggle(event);" onselected="return false;">
This appears to work. Does it look like a valid approach?
-matt -
3. Re: Rich Tree Expand node
ahoehma Oct 15, 2009 12:06 PM (in response to mattc1)Looks good ... you can define different behaviors for different node-types.
Have a look into my last blog about "customized rich tree"
http://ahoehma.wordpress.com/2009/09/10/customized-richfaces-tree/
Regards
Andreas