I have a field which is required and for which want to do a validation of the field value when the onblur event occurs. The problem is that when I add the ajax onblur event that validates the format of the data, if I put the focus on the field and pass to the next field without entering data, the required validation appears, and I don't want validate this until the submit event. How I can avoid this? My code is as follows:
<p:outputLabel value="#{i18n['identifier']}" for="nif" styleClass="ep-data-edit-field"/>
<p:inputText id="nif" value="#{personModelBean.tgssPerson.identifier}"
required="#{personSimpleModelBean.fieldValidationError == null}">
<f:attribute name="personalIdType" value="#{personModelBean.tgssPerson.tgssPersonalIdType}"/>
<f:attribute name="idPerson" value="#{personModelBean.tgssPerson.idPerson}"/>
<f:validator binding="#{personIdentifierValidator}"/>
<p:ajax disabled="#{personModelBean.tgssPerson.idPerson == null or personSimpleModelBean.fieldValidationError == null}"/>
<p:ajax event="blur" oncomplete="showDialogConditionally(args,'personDuplicatedDialog')"
update=":#{p:component('personDuplicatedDialog')}" process="@this"
disabled="#{personModelBean.tgssPerson.idPerson != null and personSimpleModelBean.fieldValidationError != null}"/>
</p:inputText>