Subwindow limit

Hello,

I’ve a window that is created from a main window that shows in a list box a set of items. I can select an item and, pressing a “delete” button, remove that item from the list. I wish to use the ConfirmDialog to ask the user to confirm the action. But ConfirmDialog open a new window and this is prevented by vaadin (it would become the second subwindow). Is there any work-around to overcome this limitation ?

thank you
Massimo

If you really must open a dialog window from another subwindow, try attaching the dialog into the application’s main window. Here’s a quick stub to illustrate the point:

public class FooWindow extends Window implements Listener {
	
	public FooWindow () {
		super();
		setCaption("FooWindow");
		addComponent(new Button("Show dialog", this, "showDialog"));
	}
	
	public void showDialog () {
		ConfirmDialog.show(getApplication().getMainWindow(), "Confirm dialog from subwindow", this);
	}

	public void onClose(ConfirmDialog dialog) {
		// TODO Auto-generated method stub		
	}

}