当组件使用ajax失去焦点而不是等待手动提交表单时,如何在输入组件上触发验证?
放一个< f:ajax event =“blur”>在UIInput组件中重新呈现< h:message>与相关组件相关联.
<h:inputText id="foo" value="#{bean.foo}" required="true"> <f:ajax event="blur" render="fooMessage" /> </h:inputText> <h:message id="fooMessage" />
另见JSF 2.0 tutorial with Eclipse and Tomcat – the view和finetuning validation