1 Reply Latest reply on Nov 21, 2007 1:04 PM by Joel Meurisse

    How to expand a tree to a specific treeNode

    hager hager Newbie

      Hello, I'm using rich:tree and i want to expand the tree to a specific node.
      i used public Boolean adviseNodeOpened(UITree tree) method, but it does not work!
      this is my method, what's wrong?

      public void nodeSelectListener(NodeSelectedEvent event)
       {
       try {
       UITree tree = (UITree)event.getComponent();
       selectedNode = tree.getTreeNode();
       rowKeySelected = (TreeRowKey) tree.getRowKey();
       tree.queueNodeExpand(rowKeySelected);
       } catch (IOException e) {
       System.out.println("Exception ici "+e.getMessage());
       }
       }
      
       public Boolean adviseNodeOpened(UITree tree) {
      
       if(rowKeySelected !=null)
       {
       try {
       tree.queueNodeExpand(rowKeySelected);
       return Boolean.TRUE;
       } catch (IOException e) {
       System.out.println("Exception ici "+e.getMessage());
       }
       }
       return null;
       }


      the problem is that all the tree is expanded, but i want to expand the tree to the rowKeySelectedNode
      please help me, I'm really desesperate!!!
      thx very much.