3 Replies Latest reply on Dec 4, 2007 12:22 PM by Michael Heinen

    Conversion error with a4j:commandButton

    Michael Heinen Newbie

      environment: myFaces 1.1.5 and a4j 1.1.1
      I can't close a wizard if there is invalid input in any field.

      My Wizard page contains an inputText field with a nested <f:validateLongRange minimum="0"/> to allow only numbers > 0.
      At the bottom of the page is a a4j:commandButton to close the wizard without any further processing. If I enter "abc" in the text field and click this cancel button then a "conversion error" occurs "Value is not a valid number".

      snippet:
      <t:inputText id="number"
      maxlength="3"
      value="#{MyController.myWizard.number}">
      <f:validateLongRange minimum="0"/>
      <a4j:support event="onchange"
      reRender="bw_p2_of1"
      oncomplete="enableSubmit();showProgressBar(false);"
      id="aChangeNumber"
      actionListener="#{MyController.dummyListener}"/>
      </t:inputText>

      <a4j:region id="aRegionCloseATBWp2 renderRegionOnly="false">
      <a4j:commandButton id="closeATBatchWizard_p2"
      ajaxSingle="true"
      immediate="true"
      action="closeATBatchWizard"
      reRender="wizard,a4jATBatchWizard"
      oncomplete="enableSubmit();showProgressBar(false);">
      </a4j:commandButton>

      I tried:
      - ajaxSingle="true" and immediate="true"
      - ajaxSingle="true"
      - immediate="true"
      all without success.


      How can I close a wizard via a4j in this case without any validation or conversion errors ?