If you open the page and then press Enter on the keyboard it executes btn1, event if I said that the default command is btn2.
Ideas?
Code: Select all
<pm:page title="Title">
<pm:view id="params">
<h:form id="form">
<p:inputText id="text">
<p:focus for="text" />
</p:inputText>
<p:commandButton value="Button1" id="btn1" action="#{bean.goHome}" />
<p:commandButton value="Button2" id="btn2" actionListener="#{bean.cleanOldSearch}" action="#{bean.search}" />
<p:defaultCommand target="btn2" />
</h:form>
</pm:view>
</pm:page>