Hello Friends,

How to call managed bean action on pressing Enter Key on the key board?

I have a simple form with a text field and button. When user hits enter
key on the key board I should be able to call searchBean.orgSearch (same
action as commandButton)

I am using Myfaces1.1

<f:view>
<h:form id="searchForm">
<tr>

<td><h:inputText id="empName" size="30"
value="#{searchBean.employeeName}"></h:inputText></td>
        
<td>&nbsp;&nbsp;<h:commandButton styleClass="button" value="Go"
id="name_btn" type="submit"
action="#{searchBean.orgSearch}"></h:commandButton></td>
        
</tr>
</h:form>
</f:view>

All suggestions are welcomed...

Nag

Reply via email to