2 Replies Latest reply on Dec 18, 2007 5:56 PM by Nick Belaevski

    rich:tree's and h:commandButton

    Auke van Leeuwen Newbie

      Okay, disclaimer first: I'm a bit of a newbie when it comes to richfaces, JSF & Seam so please bear with me.

      I'm trying to make a screen with two rich:tree's, which are used for selection of two items (from those trees).

      In my template I have something along the lines of:

      <h:form id="jobTree">
       <rich:tree
       value="#{treeManager.jobTree}"
       nodeFace="jobNode"
       var="node"
       nodeSelectListener="#{exposureByActivityManager.setJobId(node.id)}"
       ajaxSubmitSelection="true"
       >
       <rich:treeNode type="jobNode" icon="" iconLeaf="">
       <strong>#{node.id}</strong> - #{node.description}
       </rich:treeNode>
       </rich:tree>
      
       <rich:tree id="industryTree">...</rich:tree>
      
       <h:commandButton action="#{exposureByActivityManager.addJobIndustry(???)}" value="submit" />
      </h:form>


      My 'nodeSelectionListener' works, however I don't want to use that listener because I need to select something from both trees and than on the submit do something with both values, as if those two values are just two values that are saved in a regular form. Are there parameters that I can use in the action attribute along the lines of 'jobTree[selectedNode].id'?

      Or am I just totally doing this wrong? In that case: pointers anyone?