2 Replies Latest reply on Jul 14, 2009 2:37 PM by Wouter van Reeven

    invalid status remains on field when value corrected progmatically

    Andy Torble Newbie

      Hi All,


      I have a a4j:form with a number of inputText fields and a 'Fix Me' commandButton.  Each inputText field is decorated in standard seam-gen manner i.e.




      <a4j:ouputPanel id="fieldBlock1">
        <s:decorate template="layout/edit.xhtml">
          <ui:define name="label>
            <h:outputText value="#{messages['fieldLabel']}"/>
          </ui:define>
          <h:inputText value=#{backingBean.field1}>
            <a4j:support ajaxSingle="true" event="onchange" reRender="fieldBlock1" limitToList="true" bypassUpdates="false"/>
          </h:outputText>
        </s:decorate>
        <!-- other similar fields in here -->
        <a4j:commandButton id="fixMe1" action="#{actionBean.fix1}" reRender="fieldBlock1, fieldBlock2" ajaxSingle="true" limitToList="true"
      </a4j:ouputPanel>



      The fields on the backing bean are annotated with Hibernate Validators eg @Range(min=0, max=99).  When a user enters an invalid value in say field 1 the validation fires and the field is correctly decorated according to the CSS.  If the 'Fix Me' button is then clicked the actionbean fix1 method resolves any invalid/out of range values back within limits and the reRender list updates the form values etc.  At this point I would expect the #{invalid} status of the field to now be 'false' and the decoration to be removed but it isn't.  Can anyone suggest why this might be?


      If an invalid value is manually corrected all works as expected.


      BTW this is all inside a modalPanel.


      TIA


      Andy