Primefaces密码控制,按回车键调用Webflow函数

primefaces password control with press enter to call webflow function

本文关键字:调用 Webflow 函数 回车 密码 控制 Primefaces      更新时间:2023-09-26

我有下面的代码。想要调用 spring webflow 函数,然后在密码字段中按回车键时通过"selectAllEssie3S1_1"调用控制器功能。但是我发现调试时没有调用该函数。有什么问题吗??

<p:password id="encryptedKey" value="#{chkTeacherList.encryptedKeyValue}" 
onkeypress="if (event.keyCode == 13) { onchange(); return false; }">
<p:ajax event="change" action="selectAllEssie3S1_1" update="gridItemName" >
</p:ajax>
</p:password>
看看

这段代码也许可以帮助你

<p:remoteCommand name="test" actionListener="#{chkTeacherList.test}"/>
<p:password id="encryptedKey" value="#{chkTeacherList.encryptedKeyValue}"
  onkeypress="if (event.keyCode == 13) { test(); return false; }"/>
and in backing bean:
public void test() {
 System.out.println("Pressed enter! value :"+encryptedKeyValue);
}