SplitPanel Problem

I’ve a split panel into a vertical layout.
Both sides of my HORIZONTAL panel contain a vertical layout.
The first side contains just an object (a Label), the second one 4 textfields.
When I run I see my panel sized as the lefth hand side container and then I see a scrollbar in the the right hand side.
There’s enough room to visualize everything and no scrollbar would be needed.
My splitpanel hasn’t any defined size (I tried with no result).
What I missed ?

Try adding
parameter after your application url, and click “Analyze layouts” and see if you get any errors, and then try to fix those.


The message I got is
Root problems
VSplitPanelHorizontal id: PID39
Height problem: Component with relative height inside a VerticalLayout with no height defined.
Emphasize component in UI
What’s the solution ?

The solution is to either specify the height for the VerticalLaoyut mentioned in the debug message (percentage or pixel), or set the height of the SplitPanel in pixels.

Sorry but I’m not able to solve the issue.
Here my code.
superVL = new VerticalLayout();
split = new SplitPanel();
container = new VerticalLayout();
history = new VerticalLayout();
GridLayout receiver = new GridLayout(colonne * 2,1);

What’s wrong ?

The problem is the two vertical layouts with undefined height. SplitPanel is by default 100% high, which means it needs its parents to hade an explicitly defined height.

Set both vertical layout to some height (e.g. container.setHeight(“200px”) and superVL.setHeight(“200px”)) and you at least see the components. If you need it to be 100% high, then you need to make sure that the whole hierarchy off layouts up to the main window doesn’t have an undefined height anywhere.

Unfortunately I don’t know in advance the size in pixel I need because I create my screen at runtime adding fields dependin on parameters ansd conditions.
I need to have as much vertical space as I need, like any “standard” web page.
How can I arrange this?
I was able to do that without the split panel but, using the split panel, I didn’t find the way.

SplitPanel doesn’t currently support undefined sizes (naturally growing with the content), it either needs a relative or absolute size.

I’d like to first thank you for the great work your doing. Could you add this limitation to the Vaadin book or to the API documentation, it happened many time since I started to use vaadin, that I invested hours to get something in place only to find that some components doesn’t support something that almost all other components support.

I totally agree. I’ve been coding in circles all day trying to do this.

So far I’ve downloaded an add-on called SizeReporter. The idea is to capture the vertical split panel height. I then used the split position to calulate the height for each split component by multiplying the percentage against the total.

All of that is working fine. The problem is now I’m trying to listen to the split position change event. It doesn’t seem to be firing any event on the server side. I see the code but it doesn’t stop at a break point.

If I capture the split position chang event, I could at least force a fire on the sizeReporter to update my widgets. This should be much simpler, blasted css.