WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Having a "Default" commandButton

Re: Having a "Default" commandButton

by Mike Kienenberger :: Rate this Message:

| View in Thread

I seem to recall from my last Struts project that this was browser-dependent.
Generally speaking, I think either the first or the last button on the
form is the one that gets triggered by default.

On the other hand, you can set some on-click code for a particular
input component so that it activates a specific submit button.

http://wiki.apache.org/myfaces/SubmitPageOnValueChange

On 9/28/05, CONNER, BRENDAN (SBCSI) <bc1378@...> wrote:

> Is there a way to specify one's <h:commandButton> so it is the "default"
> button?  In other words, is there a way to specify it such that it is
> clicked when the user hits the "enter" key?
>
> Also, on a related note, is there a way to specify an <h:inputText> such
> that the cursor gets placed there automatically when the page loads,
> rather than requiring the user to first click on the text box before
> typing?
>
> - Brendan
>

 « Return to Thread: Having a "Default" commandButton