How to change form default button?
I have input fields inside the form as follows:
<h:inputText binding="#{MyBean.text1}" />
<h:inputText binding="#{MyBean.text2}" />
<h:inputText binding="#{MyBean.text3}" />
<h:inputText binding="#{MyBean.text4}" />
<h:inputText binding="#{MyBean.text5}" />
<h:inputText binding="#{MyBean.text6}" />
<h:inputText binding="#{MyBean.text7}" />
<h:commandButton value="search1" action="#{MyBean.search1}"
onclick="return validate();"></h:commandButton>
<h:selectOneListbox binding="#{MyBean.cboDepartment}" id="cboDepartment">
<f:selectItems binding="#{MyBean.cboDepartmentSelectItems}"
id="cboDepartmentSelectItems"
value="#{MyBean.cboDepartmentDefaultItems}" />
</h:selectOneListbox>
<h:commandButton value="search2" action="#{MyBean.search2}"
onclick="return validate2();"></h:commandButton>
Now when the user clicks enter in the input text is that the first button
action is fired, and i want to make the second button action fired without
changing the style i tried to handle the keyup event in each input but it
won't work, any ideas how to do that ?
No comments:
Post a Comment