Tuesday, September 21, 2010

Re: RootLayoutPanel adds extra divs which makes it unusable. Why?

On Sep 21, 5:33 pm, "marius.andreiana" <marius.andrei...@gmail.com>
wrote:
> Hi,
>
> In an app I was using RootLayoutPanel as it seems to be the new gwt
> 2.0 way of using panels.
>
> It generates 3 extra divs, which, besides too much markup, they also
> introduce some problems with onclick events being passed to various
> elements. I've found similar complaints from others, e.g.http://www.devcomments.com/RootPanel-vs-RootLayoutPanel-at197454.htm
>
> Going back to RootPanel removes extra divs and issues.
> The only difference between the two in docs is:
> "This panel automatically calls RequiresResize.onResize() on itself
> when initially created, and whenever the window is resized."
>
> So what's the actual purpose of RootLayoutPanel? Are the extra divs
> really necessary?

RootLayoutPanel is a container that takes up all the visible area and
always resizes to cover the whole viewport.
Other than that, it's a LayoutPanel, so it wraps all its children
within a div to be able to accurately manage their position and size
in all supported browsers. And it creates an additional, hidden, div
(two in the case of IE6) as a way to measure EMs and EXs in pixels.
So, yes, those divs are necessary.
But RootLayoutPanel and RootPanel are not interchangeable, they have
distinct purposes.

--
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment