For what reason facesContext.validationFailed could be null? (in a postBack where there are errors..)
I had to resort to an ugly if (#{fn:containsIgnoreCase(facesContext.maximumSeverity,'ERROR')}) showSecurePopup('confirm');
because facesContext.validationFailed is coming back null..
the test code is:
<h:form>
<h:messages />
<br></br>
<h:outputText value="Validation failed: #{facesContext.validationFailed}" />
<br></br>
<h:outputLabel for="field1" value="Test Field" />
<br></br>
<h:inputText required="true" />
<h:commandButton action="#{contactBacking.submitComment}" value="Submit"
<f:ajax render="@form" execute="@form" />
</h:commandButton>
</h:form>
EDIT: Edited as per @BalusC's answer.. and took screenshot of result: