3 Replies Latest reply on Feb 26, 2009 11:21 AM by Nick Belaevski

    CommandLink in Tree does not work until node is selected

    Fritz Richter Newbie

      Hi together,
      I've got a strange problem with my richfaces:tree. I tried to insert some commandLinks which are calling the same action with different parameters. Further we want to listen for treeNodeSelections.

      The problem is now, that the link of the commandLink will not work, because the tree gets the first event (selectNode).

      My question is:
      How can I change my code, so that I don't have to select the row before it is possible to follow my commandLinks? In other words: can I change the priority of the commandLinks, so that they are called before?

      <rich:tree nodeSelectListener="#{structureViewController.processSelection}"
       componentState="#{structureTreeHelper.treeState}"
       toggleOnClick="true"
       highlightedClass="highlightedTreeRow" selectedClass="selectedTreeRow"
       reRender="subMenuPanel" ajaxSubmitSelection="true" >
      
      ...
      
      <rich:treeNodesAdaptor var="system" nodes="#{system.subsystems}">
      
       <rich:treeNode icon="${request.contextPath}/../images/icons/plugin.png" iconLeaf="${request.contextPath}/../images/icons/plugin.png">
       <div class="treeNodeLabel">
       <h:outputText value="#{system.title}" id="subSystemNodeLabel"/>
       </div>
       <div class="treeNodeRightContent">
       <t:dataList var="systemRiskType" value="#{system.riskTypes}" layout="simple">
       <h:commandLink action="editSRT" >
       <f:param name="riskTypeId" value="#{systemRiskType.id}"/>
       <span class="systemRiskType" title="#{systemRiskType.riskType.name}">
       <h:outputText value="#{systemRiskType.riskType.code}"/>
       </span>
       </h:commandLink>
       </t:dataList>
       </div>