0

my problem is that I have a lot of AbsolutePanels in GWT an they are drawn as if they were a TabLayoutPanel ( the GUI looks like a TabLayoutPanel, however, it is not one, it is made of a lot of AbsolutePanels ). So, now I have the problem that as soon as a lot of tabs are opened they exceed the max. width of the AbsolutePanel and so they cannot be seen anymore nor can they be clicked or anything else. So, is it somehow possible to add a ScrollBar to this AbsolutePanel in order to scroll back and forth?

I do not think it is a good idea to post any code because everything is being done programmatically. The only thing that I would need is an example of how to accomplish a scrollbar within an AbsolutePanel. This AbsolutePanel is of a fixed width!

Thank you very much for your help in advance.

Bernd
  • 593
  • 2
  • 8
  • 31

1 Answers1

1

Use CSS Overflow property.

You just need to set overflow: auto;.

It can be done programmatically:

panel.getElement().getStyle().setOverflow(Overflow.AUTO);

or with CSS style sheet:

.overflowAuto {
    overflow: auto;
}

and

panel.addStyleName("overflowAuto");
Adam
  • 5,403
  • 6
  • 31
  • 38
  • Thank you very much, that works great - maybe one last question, if it is allowed: Since we use three panels header for the tabs, middle panel and a bottom panel for general information, I would like to know whether it is possible to show the scrollbar at the bottom of the page where the browsers scrollbar is. As soon as the scrollbar is used it should scroll through the tabs above? I cannot image that this really works. I learned a panel is where everything is being drawn, and everything is related to it. The only thing I can image is to create a big panel and then draw everything in it ... – Bernd Sep 13 '17 at 06:03
  • I'm glad I could help. As to your question: I think, that you should add new panel that would wrap tabs, body and bottom panel. The wrapping panel will scroll all its content. If you will have any specific problems with that, you can always post another question. Happy coding ;) – Adam Sep 13 '17 at 07:12
  • Thank you very much! This is what I thought, create an outer panel and wrap everything inside - this would lead to hundreds of already existing panels :) - well, then let us do it :) - Thank you very much! – Bernd Sep 13 '17 at 07:14