0 Replies Latest reply on Feb 11, 2013 11:57 AM by Ken Clahrc

    seam2.2/jsf1.2/rf3 to seam2.3/jsf2/rf4 upgrade client side validation not working

    Ken Clahrc Newbie

      Seam2.2.2.final auto-generated entry pages have 'a4j:support' components attached to each field.

      When the users enters a null value and tabs out of the field - and error message is displayed right away next to the field.

       

       

      Bellow is an example which would fire the error display when the filelds get a null for a value and is tabed out:

       

                  <s:decorate id="numPatientsField" template="layout/edit.xhtml">
                      <ui:define name="label">Total number of patients</ui:define>
                      <h:inputText id="numPatients"
                             required="true"
                                value="#{aqipHome.instance.numPatients}">
                          <a:support event="onblur" reRender="numPatientsField" bypassUpdates="true" oncomplete="onAjaxRequestComplete()"/>
                      </h:inputText>
                  </s:decorate>
      

       

      when upgrading to seam2.3.0.final / JSF2 /RF4  the 'a4j:support' got replaced with 'a4j:ajax' and now the error message is only displayed when the user clicks on the page's 'Save' button and the entire form is submitted.

       

       

                  <s:decorate id="numPatientsField" template="layout/edit.xhtml">
                      <ui:define name="label">Total number of patients</ui:define>
                      <h:inputText id="numPatients"
                             required="true"
                                value="#{aqipHome.instance.numPatients}">
                          <a:ajax event="blur" render="numPatientsField" bypassUpdates="true" oncomplete="onAjaxRequestComplete()"/>
                      </h:inputText>
                  </s:decorate>
      

       

       

      What's the way to make the upgraded version display the error message at value entry as it did previously ?

      I tried the way RF4 way explaned here using 'rich:validator' ("http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=clientValidation&skin=blueSky")- that did not work.