7 Replies Latest reply on Feb 19, 2010 6:55 AM by leelavathic

    h:selectOneMenu's  valueChangeListener is invoked on submit of a page

      Hi

       

      I have with a value change listener and a command button. Please find the code snippet as below.

       

      <a4j:form>
      ...
      <h:selectOneMenu id="status" value="#{mgdBean.status}" valueChangeListener="#{mgdBean.processStatusChange}">
          <a4j:support event="onchange" reRender="mapdMdlPnl" limitToList="true" oncomplete="showModal('#{mgdBean.showMappedVal}')"/>
          <f:selectItem itemValue="ENABLED" itemLabel="Enabled"/>
          <f:selectItem itemValue="DISABLED" itemLabel="Disabled"/>   
      </h:selectOneMenu>                
      <a4j:commandButton id="addSave"  title="Save"  action="#{mgdBean.savePage}"/>             
      ...
      </a4j:form>

       

      On click of the save button the value change listener, processStatusChange() is invoked then the control goes to savePage() action method the a4j:commandButton.

       

      Can any one tell me why the value change listener is invoked, which is not supposed to happen unlesss I change the value in it?

       

      I am using Richfaces 3.3.1 GA and its deployed in Apache Tomcat 6.0.16.

       

      Regards

      Leela