Yes, by opening the second window *when* the first is closed.
Try something like this:

abstract class Modal1 extends ModalWindow {
   public Modal1(id) {
      // ...
      setWindowClosedCallback(new ModalWindow.CloseButtonCallback() {
         @Override
         public void onClose(AjaxRequestTarget target) {
            Modal1.this.onClose(target);
         }
      });
   }
   protected abstract void onClose(AjaxRequestTarget target);
   public Modal1 showMe(target) {
      // ...
      super.show();
      return this;
   }
}

// somewhere in the page:
ModalWindow modal1, modal2;
// ...
add(modal1 = new Modal1("w1") {
   @Override
   void onClose(AjaxRequestTarget target) {
     modal2.show(target);
   }
});
add(modal2 = new Modal2("w2"));
// ...
modal1.showMe(target);

The more flexible solution is by
setting the close callback *when* the window is shown:

modal1.showMe(target).setWindowClosedCallback(new
ModalWindow.CloseButtonCallback() {
   @Override
   public void onClose(AjaxRequestTarget target) {
       modal2.show(target);
   }
});


On Thu, Jun 3, 2010 at 3:48 PM, Chris Colman
<[email protected]>wrote:

> Is it possible to replace the currently open Modal window with a
> different modal window from within the OK click handler of the currently
> open modal window?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to