ConfirmDialog error in a subwindow (subwindow in subwindow)

I get this error when trying to open a ConfirmDialog within a subwindow

com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.IllegalArgumentException: You can only add windows inside application-level windows.

:mellow:
Thanks in advance

A. Zakos,

What you will want to do is add your confirm dialog to your main application window. Something like this:

getApplication().getMainWindow().addComponent(ConfirmDialog);

I hope this helps,

Jay

silly me

ConfirmDialog.show(getWindow().getParent(), …

instead of

ConfirmDialog.show(getWindow() …

thx Jay

I am trying to implement the exact functionality. But the issue I see is after I show the popup and clicked on “Confirm” my subWindow content is changed to the mainWindow content.

That would be good if I close the subwindow too after I click on “Confirm” rather than staying on the subWindow and see the mainWindow content in subWindow.

Any Suggestions??