On 3/9/08, Warren <[EMAIL PROTECTED]> wrote:
> WebMarkupContainer bodyTag = new WebMarkupContainer("bodyTag");
>  bodyTag.add(new SimpleAttributeModifier("onload",
>  "form.username.focus();"));

Ok, but wouldn't it be cooler/easier/more java-oriented to do:

TextField userName = new TextField("userName");
userName.addBehavior(new DefaultFocusBehavior());

or

Behaviors.defaultFocus(userName); // Assuming Behaviors existed.

>
>
>  > -----Original Message-----
>  > From: [EMAIL PROTECTED]
>  > [mailto:[EMAIL PROTECTED] Behalf Of James Carman
>  > Sent: Sunday, March 09, 2008 7:58 AM
>  > To: users@wicket.apache.org
>  > Subject: Default Focus Behavior?
>  >
>  >
>  > Is there a behavior (or some other way) for having a field receive the
>  > focus when the page loads?  For instance, in a login form, you'd want
>  > the focus to go to the username field or perhaps the password field if
>  > you've got "remember me" turned on.
>  >
>
> > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to