0 Replies Latest reply on Jul 22, 2009 8:39 PM by Matt Kohanek

    Is this viable to create a rich:tree?

    Matt Kohanek Novice

      I will use three classes. The first containes a String value, projectName and a List devices; that I fill with the second Object, Device.
      This Device Object will contain two variables as well, String deviceName; and List List channels, which will contain one variable, channelName.

      Then I will use nested for loops to populate the first Class with a projectName, then the List of Device Objects, and within that for lopp populate the List of Channel Objects.

      That should make it where I only need to bind the firs ProjectHolder class to my tree, but it will have access to all three Objcts right?

      SOmthing like (this only covers projectName and devices Object.:

      <rich:tree nodeSelectListener="#{treeClickBean.projectSelection}" ajaxSubmitSelection="true" switchType="client"
       var="item" ajaxKeys="#{null}" reRender="projectForm">
       <rich:treeNodesAdaptor nodes="#{testNodesBean.projects}" var="projects">
       <h:outputLink value="/NI/explorer_click/project.jsf">
       <h:outputText value="#{projects.projectName}" />
       <rich:recursiveTreeNodesAdaptor roots="#{projects.deviceAndChannels}" var="device">
       <h:outputLink value="/NI/explorer_click/device.jsf">
       <h:outputText value="#{device.deviceName}" />

      Then I would do the same thing and add in another nested recursiveTreeNodesAdaptor for the Channels Object.

      Is this feasible? Will it show the ownership between project, device and channel like I need it to, or will this only work with two classes involved, not the third Channels class?