This content has been marked as final.
Show 5 replies
-
1. Re: Tree componentState is not working?
nbelaevski Dec 1, 2008 9:27 AM (in response to joblini)Hi,
Algorithm is the same as used for component binding: if getter doesn't return not-null result then state is created and setter is called. -
2. Re: Tree componentState is not working?
joblini Dec 1, 2008 4:40 PM (in response to joblini)Hi,
"nbelaevski" wrote:
Algorithm is the same as used for component binding: if getter doesn't return not-null result then state is created and setter is called.
OK, thanks, that explains the one and only call to setComponentState which I observerd in Debug.
The problem is that there are no further calls to setComponentState. The state of the Tree, that is, the expanded nodes, are never saved.
I also tested with RF 3.3.0 Beta, the signature has changed to use TreeState instead of DataComponentState, but the same problem exists, the state of the Tree is not saved. -
3. Re: Tree componentState is not working?
joblini Dec 2, 2008 12:42 PM (in response to joblini)Hello,
I have examined, in debug, the UITreee and UIDataAdapter classes, and I do not see any calls to setComponent other than the call from getComponent performed during initialisation of the tree's state.
It seems that the tree state is never saved by calling setComponent.
Is this a known problem?
Thank you. -
4. Re: Tree componentState is not working?
nbelaevski Dec 2, 2008 2:31 PM (in response to joblini)Hi,
This is working perfectly for me using session-scoped variable:<h:form> <h:outputLink value="/demo/faces/pages/forum13.jspx">Redirect</h:outputLink> <rich:tree value="#{treeAction.tree}" var="node" componentState="#{treeAction.state}"> <rich:treeNode> <h:outputText value="#{node}" /> </rich:treeNode> </rich:tree> </h:form>
Btw, I've used java.lang.Object as state type in order not to depend on its real type. -
5. Re: Tree componentState is not working?
joblini Dec 2, 2008 11:17 PM (in response to joblini)Thank you, you are right, it does work perfectly. I did not realize that the state was being updated in the calls to getComponentState. (I was expecting setComponentState to be called). Thanks again!