1 Reply Latest reply on Nov 21, 2007 7:43 AM by Ilya Shaikovsky

    rich:tree default nodeFace?

    Kurt Edegger Newbie


      I'm using a <rich:tree /> component with a nodeFace attribute like that:

      <r:tree value="#{groupTreeView.rootNode}" var="g" nodeFace="#{g.regionCode}" switchType="client" stateAdvisor="#{treeNodeExpandAdvisor.stateAdvisor}" >
       <r:treeNode type="AT" icon="/img/at.png" title="#{g.name}">
       <h:outputText value="AT: #{g.name}" />
       <r:treeNode type="DE" icon="/img/de.png" title="#{g.name}">
       <h:outputText value="DE: #{g.name}" />

      which renders totally great as long as the tree only consists of nodes where the regionCode is 'AT' or 'DE'.
      But if the tree contains nodes where the classification doesn't match one of the defined nodeFaces, simple the .toString method of the node is called when the node is displayed.
      I wonder if there is a possibility to define a default nodeFace in some way?
      Let's say there is a default way of rendering and only nodes where g.regionCode=='US' must be treated otherwise, how would one use nodeFaces in this situation?

      If this is not possible, I'd go for a value binding on iconLeaf of the treeNode ...

      Best regards, Kurt