14 Replies Latest reply on Jun 30, 2009 7:53 AM by ilya_shaikovsky

    Tree only shows two level, though it can go more than two le

      Hi,
      I am using <rich:recursiveTreeNodesAdaptor> to show a multilevel tree. However, it shows only two level, though it can show 10 levels.
      Following code

      <rich:tree id="metadataTreeId" style="width:300px" switchType="ajax" ajaxSubmitSelection="true" reRender="mdvalues">
       <rich:recursiveTreeNodesAdaptor id="metadataChildTreeId" roots="#{TopicSearchBean.mdRoots}" var="item" nodes="#{item.nodes}" >
      
       </rich:recursiveTreeNodesAdaptor>
       </rich:tree>
      


      The bean code

      public synchronized Metadata[] getMdRoots() {

      if (mdRoots == null) {
      Metadata metadata = MetadataService.getInstance().getMetadata("Root");
      // metadata.get
      mdRoots = metadata.getNodes();
      }
      return mdRoots;
      }

      Metadata getNodes method

      public synchronized Metadata[] getNodes() {
      if (children == null) {
      List<?> mdChildren = MetadataService.getInstance().getChildren(this.getMetadataId());
      if (mdChildren == null | mdChildren.isEmpty()) {
      children = CHILDREN_ABSENT;
      } else {
      children = new Metadata[mdChildren.size()];
      for (int x=0; x<mdChildren.size(); x++) {
      children[x] = (Metadata)mdChildren.get(x);
      }
      }
      }
      return children;
      }



      After second level, the children is not null in Metadata class, thats why it somehow shows always two level tree.
      Appreciate your help