Hi Andrew,
    It's helpful, thank you very much!

Regards,
Toby

2006/8/7, Andrew Robinson <[EMAIL PROTECTED] >:
You can use _javascript_ -- it is what I have done. Check out [1] and
look for the "clickLink" functionality. Then use a keyPress event to
look for \n or \r (I think most or all browsers use \r as enter
though), and then 'click' the link. The page below [2] is an excellent
reference and this specific page shows, in a cross-browser way, to get
which key has been pressed.

There may be easier ways, but this is by far more useful. You can trap
the escape key, arrow keys, etc. and be able to make a better user
experience.

-Andrew

[1] http://wiki.apache.org/myfaces/_javascript_WithJavaServerFaces
[2] http://www.quirksmode.org/js/events_properties.html

On 8/5/06, Hailong Zhang < [EMAIL PROTECTED]> wrote:
> I have a search bar contains a TextBox and a CommandLink. When user hit
> "Enter" in the TextBox, I don't know what happens, it seems that it refresh
> the page. Instead, I want to submit the form when "Enter" is hit, behave the
> same as use click the CommandLink.
> I have tried "j4j Tag Library, defaultAction", but it doesn't work.
>
> Any solutions?
>
> Thanks in advance.
>
> Regards,
> Toby
>

Reply via email to