Pressing enter it refreshes the page with a4j:commandButton
I've got 开发者_StackOverflow中文版this below:
<a4j:form>
<h:inputText id="name" value="#{someBean.item.name}" styleClass="medium-field" onclick="if (this.value == 'Name') this.value = ''" onblur="if (this.value == '') this.value = 'Name'" />
<a4j:commandButton action="#{someBean.find}" styleClass="bt-find" reRender="someFields"/>
</a4j:form>
When I type something on name and press Enter, it refreshes the page and does not bring me any results. If I change it to h:commandButton it works properly. Do you guys have any idea how can I make it work with a4j? If not with a4j, a way to look like a a4j.
Thanks.
Another guy who was trying to figure it out at same time as me added a "type=submit" and it worked.
<a4j:commandButton type="submit" action="#{someBean.find}" styleClass="bt-find" reRender="someFields"/>
精彩评论