2 Replies Latest reply on Feb 8, 2010 4:22 AM by matteo cremolini

    retrieve super-parent in rich:tree node

    matteo cremolini Newbie

      Hi all,

       

      how can I retrieve the parent of a node in a tree?
      In particular I would like to know the parent at any level navigation tree.


      For example:

      in the following tree...

      A__
          
      | __x
              
      | __Y
                  
      | __Z

      if I position it over Z  node, I would like to retrieve the reference to A.
      This is needed to dynamically change a context menu based on the super-parent of a node.

      Thanks for your help.

      matteo

        • 1. Re: retrieve super-parent in rich:tree node
          Nick Belaevski Master

          Hi Matteo,

           

          rich:tree can be used in several different ways. Can you please post page code to see which one you are using?

          • 2. Re: retrieve super-parent in rich:tree node
            matteo cremolini Newbie

            Hi,

            i use the   tag

            <rich:recursiveTreeNodesAdaptor>

             

             

            <rich:tree id="mittDestTree" style="width:300px" switchType="ajax"
                                    ajaxSubmitSelection="true" ajaxSingle="false"
                                    iconLeaf="/images/users_grp.gif" icon="/images/users_grp.gif"
                                    iconCollapsed="/images/tree/collapsed.gif"
                                    iconExpanded="/images/tree/expanded.gif"               
                                    reRender="treePanel" status="ajaxStatus" >

             

                                    <rich:recursiveTreeNodesAdaptor
                                        roots="#{mittDestViewBean.sourceRoots}" var="currItem"
                                        nodes="#{currItem.nodes}" > 
                                        <rich:treeNode id="nodo">
                                            <h:outputText value="tipo:#{currItem.mittDest.tipo_nodo} unita:#{currItem.mittDest.id_unita} #{currItem.miDest.descr_unita} #{curtItem.mittDest.regAssoc}"/>

                                        </rich:treeNode>

                                  </rich:recursiveTreeNodesAdaptor>
                                </rich:tree>