You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Mathias Nilsson <wi...@gmail.com> on 2009/08/02 11:47:18 UTC

Re: launching a modal page from a Panel

Define your modal window as a class variable.

class MyWebPage extends WebPage{
  private ModalWindow myWindow;

}

in the constructor

myWindow = new ModalWindow( "myWindow" );
myWindow.setPageMapName("myWindow-1");
myWindow.setCookieName("myWindow-1");
myWindow.setPageCreator(new ModalWindow.PageCreator() {
  public org.apache.wicket.Page createPage() {
    return new MyWindow();
  }
});
myWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
  public void onClose(AjaxRequestTarget target) {
  }
});
myWindow.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() {
  public boolean onCloseButtonClicked(AjaxRequestTarget target) {
    return true;
  }
});
add( myWindow );


Now, all you have to do is to call myWindow.show() in your ajaxlink.
-- 
View this message in context: http://www.nabble.com/launching-a-modal-page-from-a-Panel-tp24760576p24776275.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: launching a modal page from a Panel

Posted by Mathias Nilsson <wi...@gmail.com>.
Of course. If it is a panel then you'll do the same thing.

class MyPanel extends Panel{
   class variable....
}
-- 
View this message in context: http://www.nabble.com/launching-a-modal-page-from-a-Panel-tp24760576p24776281.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org