1 Reply Latest reply on Jan 9, 2009 5:32 AM by eirirlar

    Partial rich tree rendering - Help needed

    Abhi S Newbie

      Hi

      Have a richfaces tree structure as mentioned below.

       Root
       |
       |----Child1
       |
       |
       |----Ch1
       |
       |
       |---- Ch2


      Now when I am trying to add the add another child to node Child1, say ch3, I would like to render only Child1 and its children and not the full tree (partial rendering)

      Please find my rich tree as below
      <rich:tree
       nodeSelectListener="#{treeBean.processSelection}"
       ajaxSubmitSelection="true"
       switchType="ajax"
       changeExpandListener="#{treeBean.processExpansion}"
       adviseNodeOpened="#{treeBean.adviseNodeOpened}"
       id="tree"
       ajaxSingle="false"
       adviseNodeSelected="#{treeBean.adviseNodeSelected}"
       value="#{treeBean.rootNode}" var="item" nodeFace="#{item.type}">
      
       <rich:treeNode type="node" iconLeaf="/treemanager/images/parent_norm.gif" icon="/treemanager/images/parent_norm.gif">
       <h:outputText value="#{item.name}" style="font-size:8pt;"/>
       </rich:treeNode>
      
       <rich:treeNode type="leaf" iconLeaf="/treemanager/images/orange.gif" icon="/treemanager/images/orange.gif">
       <h:outputText value="#{item.name}" style="font-size: 8pt;"/>
       </rich:treeNode>
      
       <rich:treeNode type="next" iconLeaf="/treemanager/images/next.gif" icon="/treeemanager/images/next.gif">
       <h:outputText value="#{item.name}" style="font-size: 8pt;color:blue"/>
       </rich:treeNode>
      
       <rich:treeNode type="prev" iconLeaf="/treemanager/images/previous.gif" icon="/treemanager/images/previous.gif">
       <h:outputText value="#{item.name}" style="font-size: 8pt; color:blue"/>
       </rich:treeNode>
       </rich:tree>


      Can any one tell me how to implement it?

      Thanks
      Abhi

        • 1. Re: Partial rich tree rendering - Help needed
          eirirlar Newbie

          I would say the rendered-attribute, but that attribute is only available for the whole tree or for rich:treeNode. Since what you're asking for is conditional rendering of the parent and it's not supported, I think the only option you are left with is to:

          change the rootNode in your backing bean when you add the third child, then rerender the tree.

          Hope it helps.