Moveable Windows inside Vertical Layout


I am a new beginner to Vaadin and I really like it. I tried to put several windows inside a Vertical Layout. These windows should be freely moveable inside this Layout but the moveable windows should not cross the Layout border.

Obviously I can’t add a Window component to a Vertical Layout component so how I can still achieve this ?

Hi Thomas!

Unfortunately this is not possible without touching the VWindow widget. You basically need to extend VWindow and override the setPopupPosition(int left, int top) method to restrict the left (X) and top (Y) coordinates where you can drag the window.

You should be able to figure out the bounds of your VerticalLayout if you add a debugId to it (so that you easily can get it’s element) and query the browser for it’s top and left coordinates as well as width and height.


Thanks for the answer. I will try it.