Clearly there is something I don't understand about a4j:support here.. The following simple snippet does not rerender the outputPanel. The method myBean.test returns currentTimeMillis.
<h:form id="dummy-form"> <h:inputText id="dummy-input" value="#{myBean.foo}"> <a4j:support event="onblur" reRender="dummy-panel"/> </h:inputText> <a4j:outputPanel id="dummy-panel">#{myBean.test}</a4j:outputPanel> </h:form>
I'm now using a workaround a la this:
<h:inputText id="firstname" value="#{profile.firstName}" required="true" onblur="forceValidation()"/> <a4j:jsFunction name="forceValidation" action="#{registerProfile.forceValidation}">
The registerProfile.forceValidation method is simply a void with no functionality.
Regardless, thanks for your replies :-)
I use :
<h:messages globalOnly="true" styleClass="message"/>
for global warning and errors (like session time out). You can also use rich:messages to be able to customize its output by changing the styles depending on the type of error you get :
<rich:messages layout="table" globalOnly="true" warnClass="warning" fatalClass="errorMsg" errorClass="errorMsg" infoClass="infoMsg"/>
For validation check, you should use s:message so you get your validations messages with you input.