On 2/2/07, netfork <[EMAIL PROTECTED]> wrote:
test example abracadabra, also can't call default button' onSubmit method.
Screenshot:
http://www.nabble.com/file/6211/screenshot2.gif
That does work for me though...
The javadoc of setDefaultButton reads:
/**
* Sets the default button. If set (not null), a hidden submit button
will
* be rendered right after the form tag, so that when users press enter
in a
* textfield, this button's action will be selected. If no default
button is
* set (so unset by calling this method with null), nothing additional
is
* rendered.
* <p>
* WARNING: note that this is a best effort only. Unfortunately having a
* 'default' button in a form is ill defined in the standards, and of
course
* IE has it's own way of doing things.
* </p>
*
* @param button
* The button to set as the default button, or null when you
want
* to 'unset' any previously set default button
*/
Note the warning. The tactic I used I to put a submit button field
right after the form declaration in HTML and hide it (e.g. in the
wizard: <input type="submit" value="Next >" name="buttons:next"
style="display: none" />). Unfortunately, HTML doesn't have the
concept of a default button. The heuristic in this case is that if you
press enter in a text field, most if not all browsers will choose the
first button that was defined in the form.
Doing it with javascript (catching onkeypressed or something similar)
would be too intrusive for the framework, though it might be a good
solution for your specific case.
Eelco