0 Replies Latest reply on Jul 7, 2009 8:26 AM by jobb

    How to awoid doble view of validation errors

    jobb

      The template page contains general error view using <rich:messages, rerendered every time using ajaxRendered="true" like this :

      <rich:messages ajaxRendered="true" >
       <f:facet name="warnMarker">
       <h:graphicImage url="/pictures/error.png" />
       </f:facet>
       <f:facet name="errorMarker">
       <h:graphicImage url="/pictures/error.png" />
       </f:facet>
      </rich:messages>


      On a page using this template some of the fields should use validation based on onblur and showing the error text right after the field
      but only there. What happend is that the error text shows twice, 1 in rich:messages section and 1 in <rich:message for="ajaxFelt1" />

      <h:outputText value="Ajax Felt1" />
       <h:inputText value="#{capriMBean.ajaxFelt1}" id="ajaxFelt1">
       <rich:ajaxValidator event="onblur" />
       </h:inputText>
       <rich:message for="ajaxFelt1" />


      I'd like to show the error ones, using <rich:message for="ajaxFelt1" />. How to do it?
      I've tried with <rich:ajaxValidator event="onblur" limitToList="true" reRender="ajaxFelt1"/>
      to dismiss the behavior of the "ajaxRendered" attribute, but event="onblur" stops to work in this case.