Hi,

Thanks for your reply

please see short example:

public class WindowClosedCallbackTest extends WebPage
{
  public WindowClosedCallbackTest()
  {
    final ModalWindow window = new ModalWindow("window");
    window.setPageCreator(new ModalWindow.PageCreator()
    {
      @Override
      public Page createPage()
      {
        return new WindowClosedCallbackContentTest(window);
      }
    });
    //  window.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() // {1}
    //    {
    //      @Override
    //      public void onClose(AjaxRequestTarget target)
    //      {
    //        //        Do something
    //      }
    //    });
    add(window);
    add(new AjaxLink<Void>("button")
    {
      @Override
      public void onClick(AjaxRequestTarget target)
      {
        window.show(target);
      }
    });
  }
}

public class WindowClosedCallbackContentTest extends WebPage
{
  public WindowClosedCallbackContentTest(final ModalWindow window)
  {
    add(new AjaxLink<Void>("button")
    {
      @Override
      public void onClick(AjaxRequestTarget target)
      {
        window.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {2}
        {
          @Override
          public void onClose(AjaxRequestTarget target)
          {
            System.out.println("This text is printed with wicket 1.4, but it
doesn't work with wicket 1.5");
          }
        });
        window.close(target);
      }
    });
  }
}

If you remove comments from first {1} setWindowClosedCallback - wicket(1.5)
will use {1} instead of {2}

It's a short example, and appending setWindowClosedCallback on the
constructor level is not a solution - runtime parameters can be used into
onClose method


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-setWindowClosedCallback-tp3823361p3823895.html
Sent from the Users forum mailing list archive at Nabble.com.

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

Reply via email to