Details
Description
If I use a model validator in webflow and add an error message on the messageContext, the validationFailed flag on JSF will no be triggered. In some use cases (e.g. in a popup dialog), I need to know if validationFailed so I can hide the dialog.
I've been able to accomplish this overriding the method viewRendering on FlowFacesContextLifecycleListener:
@Override public void viewRendering(RequestContext context, View view, StateDefinition viewState) { if (context.getMessageContext().hasErrorMessages()) { FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext != null) { facesContext.validationFailed(); } } }