1 Reply Latest reply on Jul 16, 2007 4:19 AM by Jens Kunze

    deselect a TreeNode of a rich:tree

    Jens Kunze Newbie

      Hi folks,

      How can i deselect a treeNode of a rich:tree. I would like to put the selection back from outside of the tree. I have access to the tree object (HtmlTree) over value binding and the session:

      TreeRichfacesNodeHandler imih = (TreeRichfacesNodeHandler)SessionTools.getMangedBeanFromSession( Constants.TREE_HANDLER );
      
      
       if (imih.getTreeRef() != null)
       {
       HtmlTree htmlTree= (HtmlTree)imih.getTreeRef();
       >> what i do here ? <<
       >> get nodes; find selected node, deselect selected node ! <<
      
       }
      


      THX and greetz JottKa

        • 1. Re: deselect a TreeNode of a rich:tree
          Jens Kunze Newbie

          Hi again,

          after a relaxed weekend I came today to the following solution

          TreeRichfacesNodeHandler imih = (TreeRichfacesNodeHandler)SessionTools.getMangedBeanFromSession(
           Constants.TREE_HANDLER );
          
          
           if (imih.getTreeRef() != null)
           {
           HtmlTree htmlTree= (HtmlTree)imih.getTreeRef();
           TreeState ts = (TreeState)htmlTree.getComponentState();
           ts.setSelected( null );
           ts.saveState( FacesContext.getCurrentInstance() );
           }


          baba JottKa