Vaadin Composite in subwindow


For my project, I need to put some fields (TextFields, TextAreas, etc…) in a subwindow. The first method I tried was to add them into a Panel, and then add the Panel in the subwindow. It didn’t work as attended, only the Panel was put in the subwindow, without the TextFields.

So I created a new Vaadin Composite, and placed my components. But when I insert my composite in the subwindow, nothing happens…

Here is the code I use to put my composite in the subwindow.

ElementsFamille ef = new ElementsFamille();

Thanks !


Panel in a subwindow works, although it might be a bit redundant (at least if you only intend to put a single Panel inside the subwindow), since you can also set a subwindow’s caption and contents easily.

Also, adding a CustomComponent (Vaadin Composite) in a subwindow works, although there’s a small gotcha: you must set the AbsoluteLayout’s size, or use a different layout for the composite’s composition root. Example:

private void buildMainLayout() {
	// the main layout and components will be created here
	mainLayout = new AbsoluteLayout();
	mainLayout.addComponent(new Button("Hello world!"));

Hope this helps.


Thanks for your reply, setting the size of the AbsoluteLayout solved the problem. The value that was already set in % doesn’t work, I had to change it to something in pixels.