p:commandButton with onclick JS returning "false" always submits the form (via Ajax).
I expected that commandButton should submit the form only if onclick returns "true".
Also, if i use onlick="return test();", then regardless of anything it submits the whole form (full refresh).
Version: PF 2.2 , JSF 2.0, Tomcat 7
Code:
Code: Select all
<p:commandButton onlick="test();" actionListener="#{loginBean.login}" />
<script type="text/javascript">
function test() {
return false;
}
</script>
Thanks.