1 Reply Latest reply on Feb 10, 2009 6:08 AM by Prathamesh Gaddam

    Problem: Rendering rich: tree using recursiveTreeNodesAdaptor!

    Prathamesh Gaddam Novice
      Hi,

      I want to display the tree as per hierarchy of selected entity's parent and childern. The tree is processed however the on node selection the tree node, structure and order changes. I'm not sure why its happening. Tried the alternatives [http://www.seamframework.org/Community/ProblemToKeepRichtreeState] 

      Source code for TaskTree.xhtml

      <rich:tree switchType="ajax">
      <rich:recursiveTreeNodesAdaptor roots="#{tasksHome.instance.tasks == null? tasksHome.instance : tasksHome.instance.tasks}" var="taskItem" nodes="#{taskItem.taskses}">

      <rich:treeNode icon="/img/down.gif">
      <h:outputText value="#{taskItem.id}"/>
        </rich:treeNode>
      </rich:recursiveTreeNodesAdaptor>
      </rich:tree>


      Source code for Task.java

      public class Tasks implements java.io.Serializable {
      .
      .
      private Set<Tasks> taskses = new HashSet<Tasks>(0);

      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
      public Set<Tasks> getTaskses() {
           return this.taskses;
      }

      public void setTaskses(Set<Tasks> taskses) {
           this.taskses = taskses;
      }
      }