1

I have below code. Want to call spring webflow function and then controller function through "selectAllEssie3S1_1" when press enter key in password field. But I find that the function was not called when debugging. Is there anything wrong??

<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>

1 Answers1

1

take a look at this code maybe can help you

<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);
}
ZaoTaoBao
  • 2,567
  • 2
  • 20
  • 28