The panels described above are best used for defining your application's outer structure — that is, the parts that are the least "document-like". You should continue to use basic widgets and HTML structure for those parts for which the HTML/CSS layout algorithm works well. In particular, consider using UiBinder templates to directly use HTML wherever that makes sense.
I don't quite understand here. When you say you require the widget to
spread out in it's parent, do you mean:
a) The widgets added to each of the region of the split panel, namely
the north and the south, should occupy its entire given space?
or
b) the SplitLayoutPanel need to fill up its parent?
You usage of the term 'splitter' is also slightly confusing. I've
always assumed it means the little drag-able thing between the
regions, but from what I've read in your email, you seemed to name the
entire Panel splitter, is that correct?
If you want meaningful help from anybody, you'll need to post a bit
more code snippets.
-- Joe
Ah, it makes a lot more sense now.
The problem here is that you are adding a LayoutPanel, or more
generally, something that implements RequiresResize to a container
that doesn't implement ProvidesResize.
So in your specific case, you SplitLayoutPanel doesn't acquire its
size anywhere, until you've specifically given it with setPixelSize().
Off the top of my head, I can think of a few simple solutions:
a) if it's only north and south, try just using VerticalSplitPanel?
b) Switch the entire layout of you application to standards mode and
use layout panels throughout
c) Since your vertical panel cannot be resized anyway, implement a
custom ProvidesResizeWrapperPanel which sets it's own size to (100%,
100%) and, this is doable because your own panel doesn't have to use
pixel as it's unit. This custom panel then wraps the VeticalSplitPanel
inside the "position: relative" element and ensures that it calls the
VerticalSplitPanel's onResize method after it's been attached to the
DOM. Voila. :)
I hope this helps solving your problem.
-- Joe
The are compatible to a certain extend, but the underlying technology
they use are totally different.
The API of the new LayoutPanels and old Panels are very similar, so in
most cases it really is just changing the class you use that's all.
These layout panels place whatever that are inside them absolutely,
i.e., they use position: absolute and left, right, top, bottom in
order to display correctly. The advantage of this is that there's no
need for the JavaScript to interfere when the size of the window
changes and the underlying browser will take care of all of that and
in return, the performance much much better. The drawback, however, is
that all widget's size will need to be specified, you can no longer
say: I want the north to auto expand with the widget that's inside it,
instead, you can only do: the maximum size of the north is 100px, if
what's inside it is bigger, it'll need to scroll.
The reason they can't simply "fix" the old panel is that it'll break
backward compatibility, and the new layout panels won't work in quirks
mode, so I think their decision to introduce new implementations and
get the uses to make concious decisions on the switch is a good one.
> For the SplitLayoutPanel to acquire size information, will it be sufficient
> to make just the parent panels including RootLayoutPanel to be LayoutPanels?
> I suppose the child widgets could be non-layout panels, right?
That is the idea. To put it in simple terms, you can put widgets that
doesn't implement RequiresResize in LayoutPanels, but LayoutPanels
will have to be inside widgets that implements ProvidesResize, it's as
simple as that. :)
> GWT shows that HorizontalSplitPanel and VerticalSplitPanel as deprecated. Do
> they work well in standards mode? I am not sure these panels support our
> requirements either.
Good point, they may not work in standards mode. As I said in my
previous email, if you can simply switch everything to layout panels,
do that; If not, implement a custom Container widget that implements
ProvidesResize and calls the LayoutPanel's onResize() when it's
attached to the DOM tree and is visible.
Hope it helps.
-- Joe
The underlying technology are almost exactly the same between
AbsolutePanel and LayoutPanels, where widgets inside them are placed
absolutely.
HorizontalPanels and VerticalPanels place child widgets inside table
cells. And tables behave differently to divs. However, it's perfectly
fine to place Horizontal/VerticalPanels inside layout panels, provided
that you don't then place layout panels inside the
Horizontal/VerticalPanels.
I recommend reading the javadoc of the widgets you are about to use,
and ensure that they work in standards mode. There are a few widgets
that only work in quirks mode and you'll need to avoid them. GWT had
however provided substitutes to them that works in standards mode in
most cases.
Again, the key is that LayoutPanels need explicit size information,
either by being inside a ProvidesResize, or by given the size, many of
the old style Panels don't, they auto expand as their contents grow.
Sometimes for sophisticated UI, developing your own widgets will
almost be unavoidable.
HTH.
-- Joe