1 Reply Latest reply on Mar 14, 2008 10:51 AM by Nick Belaevski

    rich:tree expanding nodes advisor

    Vladimir Seprak Newbie

      Hello,

      I have tree with check-boxed leafs and attached adviseNodeOpened method which returns TRUE if node in subtree is checked, otherwise it returns FALSE.

       public Boolean adviseNodeExpand(UITree tree)
       {
      
       boolean subnodeSelected = isSubnodeSelected(tree.getRowData());
       if (subnodeSelected)
       {
       return Boolean.TRUE;
       }
       return Boolean.FALSE;
       }
      


      The idea is to display tree with expanded checked nodes. This works fine, but there is a problem that this methods is also called on subsequent user clicks which results with expanded node not collapsing and collapsed nodes not expanding.
      I need something to distinguish if this advisor is called after the tree is shown to user and return null if this is true.
      Thanx for help.