Friday, March 23, 2012

Vaadin Sub-Window Scroll Bars not Appearing

Create a Sub-Window. Add more content than what fits in view. No scroll bars appear and I can't see some of the content. Why?

The cause: I was using VerticalLayout as the content of the Window and I had called setSizeFull(). VerticalLayout.setSizeFull() sets the Height to 100%. This effectively disables scolling in the sub-window. It seems that sub window content should always have undefined height.

From the Book of Vaadin: https://vaadin.com/book/-/page/layout.settings.html
The default layout of Window and Panel is VerticalLayout with undefined height. If you insert enough components in such a layout, it will grow outside the bottom of the view area and scrollbars will appear in the browser. If you want your application to use all the browser view, nothing more or less, you should use setFullSize() for the root layout.

No comments:

Post a Comment