I was trying some examples with LayoutPanel in GWT. I tried to place a layoutpanel (with size 100%,100%) onto a ScrollPanel that in turn is attached to the rootlayoutPanel. Though the height I have assigned is 100%, it is not showing the layoutpanel to be filled in the rootlayoutpanel. Even if I add a widget to the layoutpanel, its not visible in the designer's view. I could view them by dragging explicitly the layoutpanel on the designer view. But, this would ultimately force the size to be in pixels. why am I finding this behaviour? below is the code:
RootLayoutPanel rp = RootLayoutPanel.get();
LayoutPanel lp = new LayoutPanel();
lp.setSize("100%","100%");
ScrollPanel sp = new ScrollPanel(lp);
rp.add(lp);
with this code, I could see the layoutPanel only as a line. I couldn't see the area (box) covered by Layoutpanel. If I try to manually change the height by dragging, it automatically changes the height of the layoutpanel to pixels:
lp.setsize("100%","500px");
why am I seeing this behaviour? Is there any explanation??