4 Replies Latest reply on Oct 13, 2008 4:45 PM by deanhiller2000

    how to have selectOneMenu call action method?

    deanhiller2000

      I have the following code...



      <s:decorate id="navigateDec" template="../../web/zlogin/errorTemplate.xhtml">
           <ui:define name="label">Question:</ui:define>
           <h:selectOneMenu value="#{editScript.nextNode}">
                  <s:selectItems value="#{pathActions.nodeSelectionList}" var="node" label="#{node.name}" noSelectionLabel="Please Select..." />
               <s:convertEntity />
           </h:selectOneMenu>
           <h:commandButton id="goToNode" value="Navigate to Question" action="#{editScript.changeCurrentNode()}"/>
      </s:decorate>  
                                        <s:convertEntity />
                                    </h:selectOneMenu>
      
      
              @In @Out
              private Node node;
              private Node nextNode;
           public Node getNextNode() {
                return nextNode;
           }
           public void setNextNode(Node node) {
                this.nextNode = node;
           }
           public void changeCurrentNode() {
                node = nextNode;
                nextNode = null;
                mgr.flush();
           }
      



      The commandButton works great but I would like to get rid of it such that the user just selects from the pull down and no button click is needed.  I tried adding onchange="submit();" but that doesn't work as changeCurrentNode is not called, so then I added a valueChangeListener which fails because then changeCurrentNode is called BEFORE the apply values to model phase.  I want a method called after values have been applied to the model.  How do I do such a thing?


      I basically need node to be set to nextNode and outjected from the pojo to the context BEFORE the next page is rendered.
      thanks for any help on this,
      Dean