5 Replies Latest reply on Dec 2, 2008 11:17 PM by Ingo Jobling

    Tree componentState is not working?

    Ingo Jobling Master

      Hello,

      I am attempting to save tree state (expanded nodes) across requests. As per the documentation, I am using the componentState attribute to bind the state to a backing bean. http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html/tree.html

      componentState javax.el.ValueExpression (must evaluate to org.ajax4jsf.model.DataComponentState)


      The problem is that setComponentState is only called once, when initializing the tree, and never after that, although getComponentState is called multiple times.

      When should setComponentState be called? After a post-back? After every change in the table's state?. I am stepping through the UITreee and UIDataAdapter classes in Debug, any hints or information would be greatly appreciated!

      Here is my code:

      <rich:tree style="width:300px" switchType="ajax" componentState="#{treeController.componentState}">
      


      @Name("treeController")
      @Scope(ScopeType.CONVERSATION)
      public class TreeController extends EntityController
      {
       private static final long serialVersionUID = 1L;
      
       protected DataComponentState componentState;
      // protected TreeState componentState;
      
       public DataComponentState getComponentState() {
       return componentState;
       }
      
       public void setComponentState(DataComponentState componentState) {
       this.componentState = componentState;
       }
      
      }


      I have read all posts on this subject that I could find. It appears that in the past this was accomplished using TreeState rather than DataComponentState. http://www.jboss.com/index.html?module=bb&op=viewtopic&t=119410