0

ユーザーがキーを押した場合にのみ、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" />
4

1 に答える 1