0 Replies Latest reply on Mar 18, 2008 8:31 AM by electricmonk

    recursiveTreeNodesAdaptor and nodeFace

    electricmonk

      Hi there,

      I have a tree for which nodes may have 3 different icons:
      - Leaf with some attribute
      - Leaf without said attribute
      - Non-leaf

      The tree is build using the recursive adapter. Currently, I'm able to get the tree to draw the 3 different icons using the rendered attribute of the treeNode element. I, in fact, have the same element twice, once for nodes with the attribute and one for nodes without it, with an opposite EL expression for each. The one WITH the attribute has different Icons for leaf and non-leaf statuses while the one WITHOUT has only the leaf icon (only nodes with the attribute may have children).

      From the documentation, it seems like the nodeFace attribute would make my life easier; however, it seems like I cannot use it along with the recursive adapter.

      Am I missing something?

      My code:

      <rich:tree>
       <rich:recursiveTreeNodesAdaptor roots="#{backingBean.root}" var="node" nodes="#{node.children}">
       <rich:treeNode rendered="#{node.conditionDefined}" icon="/resources/images/icons/nodeWithChildren.png" iconLeaf="/resources/images/icons/nodeDefined.png">
       <h:outputText value="#{node.displayName}" />
       </rich:treeNode>
       <rich:treeNode rendered="#{!node.conditionDefined}" icon="/resources/images/icons/nodeUndefined.png" iconLeaf="/resources/images/icons/nodeUndefined.png">
       <h:outputText value="#{node.displayName}" />
       </rich:treeNode>
       </rich:recursiveTreeNodesAdaptor>
      </rich:tree>