why does DockLayoutPanel care about the order of its elements?

116 views
Skip to first unread message

frische

unread,
Aug 9, 2011, 4:09:52 PM8/9/11
to Google Web Toolkit
Hi,
why does DockLayoutPanel need its Center Element last? Also, why does
GWT Designer allow that? Should I file a bug?

The error thrown if you add an element after the center is:
"
dockLayoutPanel.addEast(stackLayoutPanel, 12.0)

Exception during method invocation evaluation
An exception happened during evaluation of

dockLayoutPanel.addEast(stackLayoutPanel, 12.0)

Method public void
com.google.gwt.user.client.ui.DockLayoutPanel.addEast(com.google.gwt.user.client.ui.Widget,double)
was used with the parameters {<div style="position: relative; "
class="gwt-StackLayoutPanel"><div style="position: absolute; z-index:
-32767; top: -20ex; width: 10em; height: 10ex; ">&nbsp;</div><div
style="position: absolute; overflow-x: hidden; overflow-y: hidden;
"><div class="gwt-HTML gwt-StackLayoutPanelContent" style="position:
absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; ">Empty
StackLayoutPanel.</div></div><div style="position: absolute; overflow-
x: hidden; overflow-y: hidden; "><div class="gwt-HTML gwt-
StackLayoutPanelHeader" style="position: absolute; left: 0px; top:
0px; right: 0px; bottom: 0px; ">Header</div></div></div>,12.0}.
"


GWT 2.3 , gwt designer core 2.3.2.r37x201107161253

Ivan Pulleyn

unread,
Aug 9, 2011, 4:18:33 PM8/9/11
to google-we...@googlegroups.com
DockLayoutPanel assumes that "center" is all the space that wasn't taken up by a component that was added to the north, east, etc. There's a built in assumption that when you call add() you have finished adding any components that will be docked to an edge.

Ivan...


--
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.


Michael Allan

unread,
Aug 9, 2011, 6:23:34 PM8/9/11
to google-we...@googlegroups.com
Ivan Pulleyn wrote:
> DockLayoutPanel assumes that "center" is all the space that wasn't taken up
> by a component that was added to the north, east, etc. There's a built in
> assumption that when you call add() you have finished adding any components
> that will be docked to an edge.

The "add" methods for the edges (west, north etc.) seem to mix two
concerns that might better be kept separate: 1) specifying the size
constraint for each edge, and 2) adding the edge child. (Maybe that's
a bug in itself.)

As a workaround: first add a panel to each of the edges you need.
This sets the size of the edge. Later you can use the panels to add
and remove the edge children, at any time.

--
Michael Allan

Toronto, +1 416-699-9528
http://zelea.com/

Eric Clayberg (Google)

unread,
Sep 10, 2011, 9:32:12 PM9/10/11
to google-we...@googlegroups.com
In the latest GWT Designer release, it will ensure that edge widgets are added before the center widget when creating a Java UI.
Reply all
Reply to author
Forward
0 new messages