2 Replies Latest reply on Jul 7, 2009 9:29 AM by Ioana Iacob

    rich:tree node selection problem

    Ioana Iacob Newbie

      Hello,

      I have a rich tree:

      <rich:tree width="300px" value="#{Bean.tree}" var="node"
       switchType="ajax"
       nodeSelectListener="#{Bean.processTreeNodeImplSelection}"
       toggleOnClick="true" onselected="return false">
       <rich:treeNode ajaxSingle="true">
       <h:outputText value="#{node}"/>
       </rich:treeNode>
      </rich:tree>
      


      the listener is:
      public void processTreeNodeImplSelection(final NodeSelectedEvent event) {HtmlTree tree = (HtmlTree) event.getComponent();
       nodeTitle = (String) tree.getRowData();
       selectedNodeChildren.clear();
       TreeNode currentNode = tree.getModelTreeNode(tree.getRowKey());
       if (currentNode.isLeaf()){
       System.out.println("CLICK");
       }
      }
      


      The nodes are loaded dynamcally from the db, which works just fine, the problem is the listener, which is not called when I click on a node (only if I click on the icon), and sometimes gives error ( java.lang.IllegalStateException: No tree element available or row key not set!).

      Richfaces version is 3.3.0, jboss 4.2.3.

      Thank you.