ユーザーがキーを押した場合にのみ、backingbean の関数を呼び出したいと思いenter
ます。しかし、うまくいきません。Chrome のコンソールでは、Uncaught TypeError: object is not a function
ボタンを押すたびに常に返されます。コードの何が問題になっていますか? ありがとう。
<p:inputText id="txtValue" value="#{cc.attrs.value}" onkeyup="onkeypress()">
</p:inputText>
<script type="text/javascript">
function onkeypress() {
if(event.keyCode==13) {
alert("true");
} else {
alert("false");
}
}
</script>
<p:remoteCommand name="rc" actionListener="#{cc.onKeyPress}" out="count" />