On 21 sep, 23:13, Damon Lundin <[email protected]> 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?
How about implementing RequiresResize and doing the job in onResize()? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
