I use AbsolutPanel as the main panel. I add another AbsolutPanel as header to the main panel. Now I add a ScrollPanel to the main panel. The ScrollPanel includes 30 buttons on another panel. The last button is not shown completely while scrolling.
If I remove the header AbsolutPanel everything is shown - if I increase the heigh of the header panel less is shown. The scrollable area of the ScrollPanel which includes the VerticalPanel is exactly reduced with the high of the header panel which is outside of the ScrollPanel. If I use "Overflow.SCROLL" for the main panel I can scroll to the end of the verticalPanel but also the header panel is scrolled in this case.
every help is greatly appreciated - thanks!
To reproduce this problem I did the following test:
AbsolutePanel main = new AbsolutePanel();
RootLayoutPanel.get().add(main);
main.setSize("100px", "100%");
AbsolutePanel header = new AbsolutePanel();
main.add(header);
header.add(new Label("HEADER"));
VerticalPanel content = new VerticalPanel();
ScrollPanel scroll = new ScrollPanel(content);
scroll.setSize("100px", "100%");
main.add(scroll);
for (int i = 0; i < 30; i++)
content.add(new Button("Button :" + i));
Since you are using a combination of Absolute Panel, Vertical Panel and Scroll Panel, None of them are Layout Panels. So you need to see the height of Scroll Panel to some definite height, instead of giving it in percentage.
Change your code
scroll.setSize("100px", "100%");
to
scroll.setSize("100px", "500px");
And TADA, it works and you get a scroll.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With