【问题标题】:Primefaces inputText validation to occur on mouse out [duplicate]Primefaces inputText验证在鼠标移出时发生[重复]
【发布时间】:2017-08-28 14:07:47
【问题描述】:

我需要验证 inputText 框的输入。目前我有一个单击按钮以验证输入。但是,我希望在客户端鼠标点击离开 inputText 框时立即验证输入,这样就不需要验证按钮。

<h:form>
  <p:panel id="panel"> 
    <p:messages id="msgs"/>
  <p:outputLabel for="watchNoticeId" value="#{msg.rfeWatchNoticeId}" />
										
   <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>
										
   <p:commandButton value="Validate" update="panel" icon="ui-icon-check" />
  </p:panel>
</h:form>

enter image description here

【问题讨论】:

    标签: validation jsf primefaces


    【解决方案1】:

    你试过blur事件吗:

    <p:ajax event="blur" update="@this" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-20
      • 2013-12-24
      • 2014-11-29
      • 2011-08-13
      • 1970-01-01
      相关资源
      最近更新 更多