I have the code below which is just an input box and an image for the p:commandLink. My problem is that when i press the enter key, the page is just refreshed and it doesn't get inside of my submit method. If i click the image instead of hitting the enter key, everything is fine. Also if i change the p:commandLink
to a p:commandButton
hitting the enter key works too, it's just that my image doesn't look right because a button is there.
How can i get the enter key to submit a form when i'm using a commandLink instead of a commandButton?
<h:form id="searchForm">
<p:inputText id="searchBoxMember" value="#{searchBacking.anyWords}" />
<p:watermark for="searchBoxMember" value="Search" />
<p:commandLink styleClass="searchSubmitImage" ajax="false" action="#{searchBacking.submit}" />
</h:form>