Setting initial focus with UiBinder

343 views
Skip to first unread message

Tim Barthel

unread,
Jun 10, 2011, 7:54:24 PM6/10/11
to Google Web Toolkit
Hello all,

I am just getting started with gwt and trying to set the initial focus
to a TextBox with:

<g:TextBox ui:field="user" name="username" focus="true" />

However focus always starts on the first field in the panel even
though it is a label. Please help. Thanks.

Chris McBrien

unread,
Jun 11, 2011, 8:17:17 PM6/11/11
to google-we...@googlegroups.com
Try Googling "scheduler scheduledeferred focus"

Tim Barthel <onegoo...@sbcglobal.net> wrote:

Hello all,

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Tim Barthel

unread,
Jun 14, 2011, 2:27:33 PM6/14/11
to Google Web Toolkit
Thanks Chris, that works. It took me a while to figure out where to
put the calls because my app follows the MVP sample app pattern. It
still seem like a UiBinder bug and I will submit it as such.

On Jun 11, 5:17 pm, "Chris McBrien" <Chris.McBr...@sjrb.ca> wrote:
> Try Googling "scheduler scheduledeferredfocus"
>
> Tim Barthel <onegoodkni...@sbcglobal.net> wrote:
>
> Hello all,
>
> I am just getting started with gwt and trying to set the initialfocus
> to a TextBox with:
>
>                 <g:TextBox ui:field="user" name="username"focus="true" />
>
> Howeverfocusalways starts on the first field in the panel even

Craig Mitchell

unread,
Jun 27, 2011, 12:22:33 AM6/27/11
to google-we...@googlegroups.com
Not sure it is a bug.  You can't really set the focus until the page is loaded.

Just override the onLoad method and set the focus there.
Reply all
Reply to author
Forward
0 new messages