DockLayoutPanel and Tab Order

53 views
Skip to first unread message

Bryan Vergato

unread,
Oct 23, 2009, 12:52:53 PM10/23/09
to google-we...@googlegroups.com
Running 2.0m2 --

I've just noticed that when I add components to a DockLayoutPanel , the tab order is the order in which the components are added to the dock (or DOM, I suppose). 

If you add a North, South and Center component which are all focusable, the tab order will be North, South, then back up to Center, which is not the desired outcome.

Since it is an error to add any component after the center component, how does one fix up the tab order to do the right thing?  (The "right thing" being tabbing North, Center, then South)

Thanks,
b


Ian Bambury

unread,
Oct 23, 2009, 1:11:28 PM10/23/09
to google-we...@googlegroups.com
What error do you get?

You can have a play here http://examples.roughian.com/#Panels~DockPanel - if you get an error, let me know.

I think in the docs, Google says you can't but in practice (even in 2.0m2) you can.

But why aren't you using a VerticalPanel? Or even better, a FlowPanel, or even better, an HTMLPanel with styled divs in it?

It's worth trying to keep it simple if you can. Maybe you can't.

Or have a look at the new UiBinder and stick divs in that.

Bryan

unread,
Oct 23, 2009, 1:27:21 PM10/23/09
to Google Web Toolkit
You are confusing DockLayoutPanel with DockPanel -- two very different
things.

Read about Layout here:
http://code.google.com/p/google-web-toolkit/wiki/LayoutDesign

The actual error is when trying to add something after the CENTER
widget is:

java.lang.AssertionError: No widget may be added after the CENTER
widget.
DockLayoutPanel.java:359

A simple workaround is to use "LayoutPanel" instead and add the
widgets in the preferred tab order.
Once added, use the Widget Layers to set the desired locations.
This is slightly more work than using the DockLayoutPanel since you
have to position the center widget manually.

On Oct 23, 10:11 am, Ian Bambury <ianbamb...@gmail.com> wrote:
> What error do you get?
> You can have a play herehttp://examples.roughian.com/#Panels~DockPanel- if
> you get an error, let me know.
>
> I think in the docs, Google says you can't but in practice (even in 2.0m2)
> you can.
>
> But why aren't you using a VerticalPanel? Or even better, a FlowPanel, or
> even better, an HTMLPanel with styled divs in it?
>
> It's worth trying to keep it simple if you can. Maybe you can't.
>
> Or have a look at the new UiBinder and stick divs in that.
>
> Ian
>
> http://examples.roughian.com
>
> 2009/10/23 Bryan Vergato <bryan.verg...@gmail.com>

Ian Bambury

unread,
Oct 23, 2009, 2:32:09 PM10/23/09
to google-we...@googlegroups.com
Sorry, read it too quickly.
Reply all
Reply to author
Forward
0 new messages