@Jens: no, it doesn't work because, as Andrei said, whatever you add to
RootLayoutPanel takes up all the space
@Andrei: so you are suggesting to move the whole gui from RootLayoutPanel
to the LayoutPanel; I'm not sure I can do it in my case, but that's an
acceptable workaround.
Thanks
On
I need to absolute position an image in a page. A possible solution would
be to use a popup panel, but to make the page cleaner I prefer to absolute
position the image itself. I tried the code below (and some variations of
it), but the image appears contained in a div, which has top, left,
When you add a widget to a LayoutPanel, it takes up all the space unless you
specify it's position (see below). Also, you can add only one widget to the
RootLayoutPage. You can't add an image directly to it, unless your entire app
consists of this image and nothing else.
So, try this:
Hi, thank you for your reply
Actually, what you suggest doesn't work, because the image is correctly
positioned in the panel but now is the panel taking the whole space.
Unless there is some other trick, using a popup panel is the only solution
that works.
On Thursday, September 13, 2012
It does not matter which widget you are going to add to the RootLayoutPanel
- it will take the whole space. Which is great, because this is exactly how
GWT apps are built.
In my example you can add as many widgets to your LayoutPanel as you need,
and position them anywhere you want. I hope
Image img = new Image();
RootLayoutPanel.get().add(img);
RootLayoutPanel.get().setWidgetTopHeight(img, 100, Unit.PX, 12, Unit.PX);
RootLayoutPanel.get().setWidgetLeftWidth(img, 100, Unit.PX, 12, Unit.PX);
should work I guess. RootLayoutPanel is just a singleton LayoutPanel.
-- J.
--
You