RE: Dynamic adjustment of Height based on specific components

Hmm. Can you determine which panel is the higher one in code - or can the sizes of the panels change as well?


Alright, unless I’m missing something, I think you’ll then need to check the sizes from the client side and act on that information. You can do yourself with e.g. a JavaScript call or use an add-on like SizeReporter:!addon/sizereporter


Hello everyone,

I have a question about Vaadin and I am kind of new with the framework so please bear with me.

I have a Vertical Layout that contains 2 Horizontal Layouts. The first horizontal layout has a fixed expand ratio of 40%. The second one however has no expand ratio. The space that it should occupy vertically depends on the 2 panels it contains. The two panels’ height are dynamic as their heights will depend on how many components either panel has.

The issue is to make both panels equal in height taking whichever one of them is the heighest.

Now, it would be easy when I could set the expand ratio of the second horizontal layout, but I couldn’t because its height should also be dependent on the two panels.

I hope I explained it properly. And I would be really grateful for you help!

Hello, unfortunately, no. I think the best choice is to set it undefined to let its components adjust the 2 panels’ sizes. But getting either one of the panels’ height is not possible as the getHeight() returns a negative value to indicate that it is undefined.

Ahh I see. Okay, I actually thought this could be done without additional stuff. But, anyway, thank you for the answer!