The fields with tooltip messages do not go red when an ajax error is thrown in the postValidate event.
We are using PF 6.1
Code: Select all
<h:form id="formDetalle" >
<p:tooltip position="bottom"/>
<p:panelGrid columns="2" layout="grid" columnClasses="ui-g-12 ui-md-3,ui-g-12 ui-md-9">
<p:outputLabel for="email" value="email"/>
<h:panelGroup >
<p:inputText id="email" value="#{usuarioDetalle.usuario.email}" disabled="#{disableCampos}"/>
<p:message for="email" display="tooltip" />
<f:event listener="#{usuarioDetalle.validarEmail}" type="postValidate" />
</h:panelGroup>
</p:panelGrid>
<p:commandButton id="btnGuardar" value="Guardar" update="@form" actionListener="#{usuarioDetalle.guardar}" icon="fa fa-check"/>
</form>
Code: Select all
public void validarEmail(ComponentSystemEvent event) {
FacesContext fc = FacesContext.getCurrentInstance();
FacesMessage msg = new FacesMessage("Ya existe un usuario registrado con este mail");
msg.setSeverity(FacesMessage.SEVERITY_ERROR);
fc.addMessage("formDetalle:email", msg);
fc.renderResponse();
}
Normal validation works
Validation in event postValidate fails (It does not turn red)