VerticalLayout components aligment

Vaadin 7.06

I need to show NativeSelect and tree with scroll bars in vertical aligment.
That will be CustomComponent in Window

layout code like this:


VerticalLayout verticalLayout = new VerticalLayout();
        verticalLayout.setSpacing(false);
        verticalLayout.setSizeFull();

        Panel select = new Panel(outlineNodeSelect);
        select.setHeight(null);

        Panel tree = new Panel(outlineTree);
        tree.setHeight("100%");

        verticalLayout.addComponents(select,tree);

        setCompositionRoot(verticalLayout);

This divide vertical layout in half making select and tree panels of equal heights and resulting big space between components
like this

How to force tree panel to use all avaible height?

Setting the expand ratio should do that:
verticalLayout.setExpandRatio(tree, 1);
that is, after you have added the components to the layout.

Do i need to always call setExpandRatio for this kind of problem? I got similar problem like this:

1)Parent VerticalLayout (structure) => h 100%, w 100%
– 2) Child VerticalLayout (dinamy formcontent) => h 100%, w 100%
– --3) Children of item 2. A list of components like text boxes, tables … this children should fit in its parent area, but they dont need to expand. Just occupy their parent´s area. In some cases, a child its a table with 100% height, to full fill parents area.

I´m not able to do that, because if i set parent´s height to 100% vaadin ALWAYS tries to fullfill the area.

How can i build a solution for that?