Page component extended vertically

Hello Vaadin users!

Is there any way to set up the height of the web page components (for example the vertical SplitPanel) to be as height as the current web page height (extend vertically)?
I have a tree at the panel. When I will set the panel height for a 100% then the panel does not occupy the whole available vertical space (height of the web browser window). I can always set the height with “setHeight”, but it depends on client screen resolution.

Best regards
Marcin

Hi Marcin,

You need to make sure that the layout / panel / window containing your splitpanel also is 100% high all the way up to the main window for the splitpanel to be able to occupy 100% of the browser window height.

Here’s a short example:


public class HelloworldApplication extends Application {
    @Override
    public void init() {
        final Window mainWindow = new Window("Helloworld Application");
        ((VerticalLayout) mainWindow.getContent()).setSizeFull();
        SplitPanel splitPanel = new SplitPanel();
        splitPanel.setSizeFull();
        mainWindow.addComponent(splitPanel);
        setMainWindow(mainWindow);
    }
}

Notice the ((VerticalLayout) mainWindow…) line that makes the content in the main window be 100% high and 100% wide.

HTH,
/Jonatan