How to create a modal window within a modal window?

Hello!

I’m trying to create a modal window within a modal window, that is, I want the window overlaps another window. However, the system is returning me the following exception:

java.lang.IllegalArgumentException: You can only add windows inside application-level windows.

Is there any way to create this second window?

My code to create a new modal window:


//Scala Code
view.newPlaceButton.addListener(new Button.ClickListener() {
      def buttonClick(event: Button#ClickEvent) {
        val w = new NewPlaceContent
        val p = new NewPlacePresenter
        view.getWindow.addWindow(w)
        p.init()
        p.bindView(w)
      }
    })

Regards…

Windows can only be attached to the main window so you can’t really have a window in a window.
If all you want to do is display a modal window in front of another modal window, try adding it to the main window, it should pop up in front of the previous one.

Then if it is not perfect, with some CSS you should be able to do what you want.

Note : It is just an idea, I have never tried myself.

In this case, the “view” attribute is a window. It was added in main window. Then, when I retrieve the main window by “view.getWindow” call I actually am adding the new window inside the main window. But I catch this exception.