2 Replies Latest reply on Oct 22, 2008 8:04 AM by Smitha Ramaswamy

    tree maintaining state not working.

    Smitha Ramaswamy Newbie

      I have a dynamic tree that is retrieving nodetext from database. I also have the implementation for 2 levels of treenode opened when tree is displayed,
      What I need now is I want to maintain the state of the tree when I click any leafnode. I tried to follow this link My Link
      but, not succesful. I am using attribute componentState from treeComponent, 



      <rich:tree switchType="client" stateAdvisor="#{treeStateAdvisor}" componentState="${treeComponentState}">





      @Scope(ScopeType.SESSION)
      @Name("treeComponentState")
      public class TreeComponentState {
      
           private UITree tree;
      
           private TreeState treeState;
      
           public UITree getTree() {
                return tree;
           }
      
           public void setTree(final UITree tree) {
                this.tree = tree;
           }
      
           public TreeState getTreeState() {
                return treeState;
           }
      
           public void setTreeState(final TreeState treeState) {
                this.treeState = treeState;
           }
      
      }




      I am not sure if I am using componentState in proper way. How is the tree manipulated to keep the state? Any help is appreciated.