2 Replies Latest reply on Jun 22, 2011 5:27 AM by saiprasad.krishnamurthy

    please, help me in richfaces tree

      So, I'm newcomer in richfaces
      Please! anybody! help me in rich:tree-learning!!!!
      How create tree with selected leaf-node
      or expanded node (if it is not leaf)??????????[/img]

        • 1. Re: please, help me in richfaces tree
          roykachouh

          I successfully implement a richfaces tree in one of my projects...

          below is the code, hope that helps...

          
          <rich:tree adviseNodeOpened="#{API.relationshipScreen.isNodeExpanded}" style="width:300px" value="#{API.relationshipScreen.relationship.data}" var="item" nodeFace="#{item.type}" switchType="client">
           <rich:treeNode type="ultimate">
           <h:outputText value="#{item}" />
           </rich:treeNode>
           <rich:treeNode type="immediate">
           <h:outputText value="#{item.folderName}" />
           </rich:treeNode>
           <rich:treeNode type="leaf">
          
           <h:outputText value="#{item.fileName}" />
           </rich:treeNode>
          
           </rich:tree>
          


          • 2. Re: please, help me in richfaces tree
            saiprasad.krishnamurthy

            Hello there,

             

                                     I'm a newbie to Richfaces and I should say the components are nice and simple. Thanks for these wonderful stuff. However I'm trying to achieve something using the tree that I couldn't find in any of the documentation.

             

            I want the tree to behave in a way such that

            1. If I select any node, it should select the node and expand the node (if its not a leaf node)
            2. If I expand any node, it should select the node and expand the node (if it's not a leaf node)

             

            Basically I want the select and expand events to be treated as the same. Any clues/workarounds would be greatly appreciated. Thanks.

             

            JSF 2.0 + Richfaces 4.0.0.Final + Mojarra 2.0.3 + tomcat 7.0.12