On 21 sep, 23:13, Damon Lundin <
damon.lun...@gmail.com> wrote:
> I am attempting to use the new GWT LayoutPanels and unfortunately they
> are causing me some grief. We are using the layout panels
> (RootLayoutPanel, DockLayoutPanel, LayoutPanel, etc) to arrange the
> overall layout of the panel. Then, the children of one of these
> panels needs to know how big it is so that it can size one of its
> children properly to cause a scroll bar to appear. Generally you do
> this by calling getOffsetWidth and getOffsetHeight. I know that these
> methods will return 0 if the widget is not attached but I am finding
> that in even putting the calls in onLoad, these methods are still
> returning 0. Clearly I don't understand when GWT and/or the browser
> figures out what the sizes of these layout panels are.
>
> Below is a simplification of my problem. The widget added to the
> RootLayoutPanel cannot determine its size when it is attached to the
> DOM. I made sure the widget had something in it and to prove that it
> ends up with a size, I added the call to the deferred command to
> display the size again.
>
> If you simply replace "RootLayoutPanel" with "RootPanel" then it will
> output a size. What am I doing wrong here?