The problem:
While the cursor is in the inputText and I press the “Enter” the dialog will popup
This is happen in Chrome but not via IE:
<h:form id="mainForm" prependId="false">
<h:inputText id="globalFilter" onkeypress="if(event.keyCode == 13){}"/>
<p:commandButton id="Button1"
oncomplete="widgetVar.show()"/>
<p:dialog id="Dialog1"
widgetVar="widgetVar"
appendToBody="true"
dynamic="true"/>
</h:form>
How can I prevent it ?
Thanks
You can just add
return falseto stop this event.Like
onkeypress="if(event.keyCode == 13){return false;}"