This content has been marked as final.
Show 3 replies
-
1. Re: How to keep the richfaces tree state across requests?
mail.micke Dec 18, 2007 8:26 AM (in response to seammer)Yeah,
I know.
Very simple really, just put a TreeState object in the backing bean and use the componentState" attribute of the rich:tree.
I think you can find some more info by searching the forum, if not let me know and i'll write some code down (not at work atm, in another country).
I still wish a richfaces developer could comment on if it is possible to preserve the tree state without using ajax switchType. Would be nice to hear from someone who knows their stuff.
- Mike -
2. Re: How to keep the richfaces tree state across requests?
seammer Dec 18, 2007 8:34 AM (in response to seammer)"mail.micke@gmail.com" wrote:
Yeah,
I know.
Very simple really, just put a TreeState object in the backing bean and use the componentState" attribute of the rich:tree.
I think you can find some more info by searching the forum, if not let me know and i'll write some code down (not at work atm, in another country).
I still wish a richfaces developer could comment on if it is possible to preserve the tree state without using ajax switchType. Would be nice to hear from someone who knows their stuff.
- Mike
Thanks for your kind reply Mike.
I looked for almost everywhere and can could not find that kind of code.
Do you mind if you could share a piece of code especially in the backing bean?
I have a clue for other switchType.
However, I'am missing a part of the API to solve that problem. -
3. Re: How to keep the richfaces tree state across requests?
mail.micke Dec 18, 2007 9:47 AM (in response to seammer)Hi,
on the backing bean :private TreeState treeState;
+ getters and setters
XHTML :<rich:tree id="treeId" value="#{treeData}" switchType="#{userMenu.switchType}" nodeSelectListener="#{userMenu.onSelect}" changeExpandListener="#{userMenu.onExpand}" var="item" iconExpanded="/_graphics/_icons/bookfolderopen.gif" iconCollapsed="/_graphics/_icons/bookfolder.gif" componentState="#{userMenu.treeState}" nodeFace="#{item.nodeFace}"> .... </rich:tree>
The important bit being the "componentState" attribute.