-
1. Re: Html Component class for rich:tree
nbelaevski Dec 20, 2010 7:08 PM (in response to nirvanbd)Hi Nirvan,
It's org.richfaces.component.UITree. Also JSF spec. strongly recommends against storing UI components in session-scoped beans; so just bind 'expanded' attribute of tree node to the model and store state of the tree there.
-
2. Re: Html Component class for rich:tree
nirvanbd Dec 20, 2010 10:05 PM (in response to nbelaevski)Hi Nick,
I tried to implement your suggestion, and it worked partly. I have created a boolean variable in my TreeNode class that keeps track of its expanded state. However, I am not able to set that variable because I don't know which event I can use to set that variable. I used following
<rich:treeNode expanded="#{treeMenuBean.nodeExpanded}>
and here are the javabean methods
public boolean isNodeExpanded(){...} public void setNodeExpanded{...}
The problem is that isNodeExpanded() is getting called correctly, but setNodeExpanded() is not called. As a result, I am unable to set the boolean variable in my TreeNode class.
regards,
Nirvan
-
3. Re: Html Component class for rich:tree
nbelaevski Dec 21, 2010 8:35 AM (in response to nirvanbd)Nirvan,
I've remembered that there was an issue with 'expanded' attribute in M4. It should be fixed in M5, can you please try with the latest 4.0.0-SNAPSHOT?
-
4. Re: Html Component class for rich:tree
nirvanbd Dec 21, 2010 9:21 AM (in response to nbelaevski)Nick,
Since I am using toggleType="client", I don't think it would be possible to use the expanded property for setting the nodes expanded. To support this I tried using toggleType="ajax" and the setter setExpandedNode(boolean expanded) gets correctly called.
Also, I have outputLink in the nodes that point to different xhtml pages, so the richTree component wont be restored and a new one will be created in the xhtml page identified by the outputLink clicked.
I seem to be stuck, although I have employed a crude fix (for temporary testing).
Are the snapshots available as direct download? actually I am not very familiar with the maven
Thanks
Nirvan
-
5. Re: Html Component class for rich:tree
nbelaevski Dec 21, 2010 5:08 PM (in response to nirvanbd)Nirvan,
The simplest way is to download showcase and extract RF .jar files from there: http://snapshots.jboss.org/maven2/org/richfaces/examples/richfaces-showcase/4.0.0-SNAPSHOT/.