Primefaces inputText验证发生在鼠标上
问题描述:
我需要验证inputText框的输入。目前我有一个按钮被点击以验证输入。但是,我希望在客户端鼠标离开inputText框时立即验证输入,以便不需要验证按钮。Primefaces inputText验证发生在鼠标上
<h:form>
<p:panel id="panel">
<p:messages id="msgs"/>
<p:outputLabel for="watchNoticeId" value="#{msg.rfeWatchNoticeId}" />
\t \t \t \t \t \t \t \t \t \t
<h:panelGrid columns="2" cellpadding="5">
<p:inputText id="watchNoticeId" value="#{watchNotice.id}" size="20" style="vertical-align: top;" disabled="#{! raudUserSessionBean.raudUser.referMode}">
<p:ajax event="change" process="@this" />
<f:validateLength maximum="18" update="panel" />
</p:inputText>
<p:message for="watchNoticeId" display="icon" />
</h:panelGrid>
\t \t \t \t \t \t \t \t \t \t
<p:commandButton value="Validate" update="panel" icon="ui-icon-check" />
</p:panel>
</h:form>
答
您是否尝试过blur
事件:
<p:ajax event="blur" update="@this" />