1 Reply Latest reply on Jul 19, 2007 4:11 AM by Alexander Jiteg

    Second click does not invoke my action method..

    Alexander Jiteg Newbie

      I have created a jsf-page where I intend to rerender parts of the page using ajax depending of a value chosen in a selectOneMenu...

      When testing my page the first pick in the menu produces the result that I want and the block rerenders as expected but for the second, the action method is never invoked at all... The third, forth and so on works as expected again..

      It's only the second pick that fails. It seems that the event, onchange is never called for the second one? Any ideas?

      Code and logs attached below. Thanks.

      .....
      <h:selectOneMenu id="companytype" styleClass="inputfield" value="#{companyDetailBackingBean.type}">
      <f:selectItem itemLabel="Customer" itemValue="customer"/>
      <f:selectItem itemLabel="Partner" itemValue="partner"/>
      <f:selectItem itemLabel="Relation" itemValue="relation"/>
      <a4j:support event="onchange" action="#{companyDetailBackingBean.checkChoosenCustomerType}" reRender="form:wrappercanvas"/>
      </h:selectOneMenu>

      .....

      <t:div id="wrappercanvas">
      <a4j:outputPanel styleClass="canvas" layout="block" id="invoiceterms" style="width:290px;" rendered="#{companyDetailBackingBean.showInvoiceTermsDiv}">
      <h:panelGrid border="0" columns="2" headerClass="canvasheader" columnClasses="leftColumn, rightColumn" >
      <f:facet name="header">
      <h:outputText value="#{adminbundle['companyDetails.invoiceterms']}:"/>
      </f:facet>
      <h:outputText value="#{adminbundle['companyDetails.paymentterm']}: " />
      <h:selectOneMenu id="paymentterm" styleClass="inputfield">
      <f:selectItem itemLabel="30 dagar" itemValue="30"/>
      <f:selectItem itemLabel="60 dagar" itemValue="60"/>
      <f:selectItem itemLabel="90 dagar" itemValue="90"/>
      </h:selectOneMenu>
      <h:outputText value="#{adminbundle['companyDetails.creditterm']}: " />
      <h:selectOneMenu id="creditterm" styleClass="inputfield">
      <f:selectItem itemLabel="30 dagar" itemValue="30"/>
      <f:selectItem itemLabel="60 dagar" itemValue="60"/>
      <f:selectItem itemLabel="90 dagar" itemValue="90"/>
      </h:selectOneMenu>
      <h:outputText value="#{adminbundle['companyDetails.invoiceperiod']}: " />
      <h:inputText id="invoiceperiod" styleClass="inputfield" value="" maxlength="20" size="20" />
      </h:panelGrid>
      </a4j:outputPanel>
      </t:div>

      ....

      _____

      public void checkChoosenCustomerType(){
      if(type.equals("customer")){
      if (log.isDebugEnabled()) {
      log.info("Customertype choosen");
      }
      showInvoiceTermsDiv=true;
      }else if(type.equals("partner")){
      if (log.isDebugEnabled()) {
      log.info("Partnertype choosen");
      }
      showInvoiceTermsDiv=true;
      }else if(type.equals("relation")){
      if (log.isDebugEnabled()) {
      log.info("Relationtype choosen");
      }
      showInvoiceTermsDiv=false;
      }
      }

      _____

      Phase tracker logs for first and second pick:

      17:22:13,795 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE RESTORE_VIEW 1
      17:22:13,796 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER RESTORE_VIEW 1
      17:22:13,796 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE APPLY_REQUEST_VALUES 2
      17:22:13,798 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER APPLY_REQUEST_VALUES 2
      17:22:13,799 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE PROCESS_VALIDATIONS 3
      17:22:13,801 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER PROCESS_VALIDATIONS 3
      17:22:13,802 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE UPDATE_MODEL_VALUES 4
      17:22:13,803 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER UPDATE_MODEL_VALUES 4
      17:22:13,804 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE INVOKE_APPLICATION 5
      17:22:13,804 INFO [STDOUT] 17:22:13,804 INFO [UserBackingBean] Relationtype choosen
      17:22:13,805 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER INVOKE_APPLICATION 5
      17:22:13,805 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE RENDER_RESPONSE 6
      17:22:13,849 ERROR [STDERR] 2007-jul-18 17:22:13 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER RENDER_RESPONSE 6
      17:22:16,981 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE RESTORE_VIEW 1
      17:22:16,984 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER RESTORE_VIEW 1
      17:22:16,985 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE APPLY_REQUEST_VALUES 2
      17:22:16,987 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER APPLY_REQUEST_VALUES 2
      17:22:16,987 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE PROCESS_VALIDATIONS 3
      17:22:16,989 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER PROCESS_VALIDATIONS 3
      17:22:16,991 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE UPDATE_MODEL_VALUES 4
      17:22:16,993 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER UPDATE_MODEL_VALUES 4
      17:22:16,993 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE INVOKE_APPLICATION 5
      17:22:16,994 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER INVOKE_APPLICATION 5
      17:22:16,995 ERROR [STDERR] 2007-jul-18 17:22:16 org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE RENDER_RESPONSE 6
      17:22:17,057 ERROR [STDERR] 2007-jul-18 17:22:17 org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER RENDER_RESPONSE 6

      _______________________________