3 Replies Latest reply on Feb 13, 2009 2:50 AM by Prathamesh Gaddam

    Problem: Rendering rich: tree using recursiveTreeNodesAdapto

    Prathamesh Gaddam Novice

      Hi,

      I want to perform a edit action [navigate to edit page] using contectMenu on each treeNode. Presetly the contextMenu is displayed on nodes however the page is not navigated from each node. Only selection of nodes from some nodes [first 2/3 hierarchy] menuItem action is performed.

      I'hv tried both the options
      1.contextMenu within treeNode [working partially as described above] and 2.contextMenu outside the rich:tree using componentControl

      Please guide as how it can be resolved. The code is as below [commented code, used with componentControl (2nd option) ]

      Thank you in advance !
      -------------------------------------------------------------------------------------
      TaskTree.xhtml

      <a:form id="tasksSearch" styleClass="edit">
      
       <!-- CONTEXT MENU
       <rich:contextMenu attached="true" id="treeMenu" submitMode="ajax">
       <rich:menuItem>
       Selected Task ID:<b>{taskId}</b>
       </rich:menuItem>
       <rich:menuItem action="Edit">
       <h:graphicImage value="/img/edit.gif" border="0"></h:graphicImage>
       <h:outputText value="#{resourceBundle.labels['list.edit']}"></h:outputText>
       <a:actionparam name="tasksId" value="{tasksId}"/>
       </rich:menuItem>
       </rich:contextMenu>
       -->
      
       <!-- TREE -->
       <rich:panel>
       <rich:tree id="tasksTree" switchType="client">
       <rich:recursiveTreeNodesAdaptor roots="#{tasksHome.instance.tasks == null? tasksHome.instance : tasksHome.instance.tasks}" var="taskItem" nodes="#{taskItem.taskses}">
       <rich:treeNode icon="/img/down.gif">
       <h:outputText value="#{taskItem.id}"/>
      
       <!-- Inner contextMenu -->
       <rich:contextMenu event="oncontextmenu" attached="true" id="treeMenu" submitMode="ajax">
       <rich:menuItem>
       Selected Task ID:<b>#{taskItem.id}</b>
       </rich:menuItem>
       <rich:menuItem action="Edit" limitToList="true">
       <h:graphicImage value="/img/edit.gif" border="0"></h:graphicImage>
       <h:outputText value="#{resourceBundle.labels['list.edit']}"></h:outputText>
       <f:param name="tasksId" value="#{taskItem.id}"/>
       </rich:menuItem>
       </rich:contextMenu>
       <!-- Inner contextMenu -->
      
       </rich:treeNode>
       </rich:recursiveTreeNodesAdaptor>
      
       <!-- ComponentControl within TREE
       <rich:componentControl event="onSelected" attachTo="tasksTree" for="treeMenu" operation="show">
       <f:param name="taskId" value="#{taskItem.id}"/>
       </rich:componentControl>
       -->
      
       </rich:tree>
       </rich:panel>
      
      </a:form>
      
      


      TasksTree.page.xml

      <param name="tasksId" value="#{tasksHome.tasksId}"/>
       <param name="taskId"/>
      
       <navigation from-action="Edit">
       <end-conversation />
       <redirect view-id="/TasksEdit.xhtml" />
       </navigation>