This content has been marked as final.
Show 3 replies
-
1. Re: Execute on enter
jazir1979 May 29, 2008 8:11 PM (in response to bostone)Seam provides an s:defaultAction tag which might do what you want. I took at quick look at the source in org.jboss.seam.ui.renderkit.DefaultActionRendererBase and it traps keycode 13 (enter) and clicks the given button.
-
2. Re: Execute on enter
bostone May 30, 2008 2:14 AM (in response to bostone)Unfortunately we are not using seam on this project. It is rather strange that such major piece of functionality is not implemented by default
-
3. Re: Execute on enter
bostone May 30, 2008 2:41 AM (in response to bostone)If anyone is interested I found the solution on this very forum. Here it is
<h:inputText id="quickSearch" value="#{deviceMasterFormBean.criteria.quickSearch}"> <a4j:support event="onkeyup" onsubmit="if (event.keyCode != 13) { return false}" actionListener="#{deviceMasterFormBean.search}" reRender="searchResultPanel,searchTogglePanel,toggleTwo"> <a4j:actionparam value="0" assignTo="#{deviceMasterFormBean.searchType}" /> </a4j:support> </h:inputText>
As you can see - this does the trick:<a4j:support event="onkeyup" onsubmit="if (event.keyCode != 13) { return false}" />