4 Replies Latest reply on Jan 26, 2009 10:37 AM by safa

    treemenu + link

    safa

      Hi,
      I work with jboss seam and richfaces;
      I have a treemenu:

      <rich:tree
       style="width:300px"
       rendred="true"
       nodeSelectListener="#{menu1.processSelection}"
       reRender="selectedNode"
       switchType="client"
       value="#{menu1.treeNode}"
       ajaxKeys="#{null}"
       ajaxSubmitSelection="true"
       var="item">
       </rich:tree>
      


      it work very well, but I would like to be redirected to an other page when I click on a tree node,
      Have any body any idea??
      thx

        • 1. Re: treemenu + link
          ilya_shaikovsky

          You may define a few treeNodes for different types. just use outputLink inside some treeNode.

          • 2. Re: treemenu + link
            safa

            ths for your reply
            I tried this code, but it doesn't work


            <rich:tree
             style="width:300px"
             rendred="true"
             nodeSelectListener="#{menu1.processSelection}"
             reRender="selectedNode"
             switchType="client"
             var="item"
             value="#{menu1.treeNode}"
             ajaxKeys="#{null}"
             ajaxSubmitSelection="true"
             nodeFace="#{treeNode.parent.parent == null ? 'node' : 'leaf'}"
             >
             <rich:treeNode type="node">
             <h:outputText value="#{item}"/>
             </rich:treeNode>
             <rich:treeNode type="leaf" >
             <h:outputLink value="http://localhost:8089/Sigpn/AireProtegeeList.seam">
             <h:outputText value="#{item}"/>
             </h:outputLink>
             </rich:treeNode>
             </rich:tree>


            Can you correct it, if there is some mistakes, please???

            • 3. Re: treemenu + link
              ilya_shaikovsky

              what did you mean by doesn't work ;)

              not rendered as link
              link rendered but not works
              and so on..

              b.t.w. set ajaxSubmitSelection=false on the treeNode with links.

              • 4. Re: treemenu + link
                safa

                Now it's working, I'am redirect to an other page jsf,
                for those have the same problem, the final code is:

                
                <rich:tree
                 style="width:300px"
                 rendred="true"
                 switchType="client"
                 var="item"
                 value="#{menu1.treeNode}"
                 treeNodeVar="treeNode"
                 nodeFace="#{treeNode.parent.parent.parent.parent.parent == null ? 'leaf' : 'node'}"
                 reRender="selectedNode"
                 ajaxKeys="#{null}"
                 ajaxSubmitSelection="true">
                
                 <rich:treeNode type="node" >
                 <h:outputText value="node #{item}"/>
                 </rich:treeNode>
                
                 <rich:treeNode type="leaf"
                 nodeSelectListener="#{menu1.processSelection}" >
                
                 <s:link view="/Parc.xhtml"
                 value="leaf #{item}"
                 id="parc">
                 <f:param name="parcId"
                 value="#{menu1.nodeTitle}"/>
                 </s:link>
                
                 </rich:treeNode>
                
                 </rich:tree>
                
                


                thx for your help ilya_shaikovsky, :)