This content has been marked as final.
Show 2 replies
-
1. Re:
ybxiang.wolf Apr 17, 2008 4:22 AM (in response to elmarweber)I am finding the same resolutions!!!
Any sugesstion? -
2. Re:
elmarweber Apr 17, 2008 11:10 AM (in response to elmarweber)Hello,
OK, shouldn't try stuff so late =)
Somehow I always worked on the "<rich:suggestionbox>" tag instead the "<h:inputtext>", which of course could not work.
Here is my solution in case anyone searches for the same:
On the inputText tag add a call to a javascript function in case of a key press, e.g.:<h:inputText value="#{someBean.text}" id="search" required="false" autocomplete="off" onkeypress="catchReturn(event)" />
somewhere appropriate define a JavaScript function catchReturn/** * Catches the return key and executes an action in that case. */ function catchReturn (e) { var keycode; if (window.event) { // IE keycode = e.keyCode; } else if (e.which) { // real browsers keycode = e.which; } if (keycode == 13 || keycode == "13") { someReturnAction(); } }
Finally define someReturnAction() function such that it executes the Java method on return:<a:jsFunction name="addItem" reRender="listN" action="#{someBean.yourSubmitFunction}" focus="search" />
ciao,
Elmar