How to get the actual size (width, height) of a component?

Trying to circumvent the odd behavior of SplitLayout (see other thread) I was trying to calculate the splitter position using the actual width of two components (because one has to provide the location as a percentage of relative sizes).
And I emphasize: actual width, since the getWidth() or getHeight() methods return initial values which are typically 0 or 100% and are thus useless as they don’t reflect reality.

BUT: As I had to learn it seems to be a major problem to get hold of the actual size (width, height) of a component.

I tried different solutions that I found by googling around but all failed.
Two proposed solutions were based on different add-ons that people had written for Vaadin 7 or 8 but which apparently don’t work anymore with Vaadin 14.

Is there a working solution for this problem for Vaadin 14?
I would appreciate a pointer or a code snippet.

Hi,

Maybe you can check the solution I posted in this link: https://vaadin.com/forum/thread/16954389/how-get-items-size-in-pixels?utm_campaign=site_notifications&utm_medium=forum&utm_source=email

(the end of the link is for Vaadin 14)

If you have

In your case ( splitlayout), maybe this workaround can help you: https://github.com/vaadin/vaadin-split-layout/issues/152