Re: Problem with setWindowClosedCallback
Looks like serialization problem. Does anybody know how it works? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-setWindowClosedCallback-tp3823361p4452909.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
Re: Problem with setWindowClosedCallback
Does this problem still not documented? Does anyone know a solution to this problem? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-setWindowClosedCallback-tp3823361p4452543.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
Re: Problem with setWindowClosedCallback
I would say this is the only difference in ModalWindow between 1.4 and 1.5. Now we just need someone to document it in the migration guide. There we a few tickets about storing state in one page and expecting to see it in a callback executed in another page. On Mon, Sep 19, 2011 at 4:32 PM, vov wrote: > 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("button") > { > @Override > public void onClick(AjaxRequestTarget target) > { > window.show(target); > } > }); > } > } > > public class WindowClosedCallbackContentTest extends WebPage > { > public WindowClosedCallbackContentTest(final ModalWindow window) > { > add(new AjaxLink("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 > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem with setWindowClosedCallback
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("button") { @Override public void onClick(AjaxRequestTarget target) { window.show(target); } }); } } public class WindowClosedCallbackContentTest extends WebPage { public WindowClosedCallbackContentTest(final ModalWindow window) { add(new AjaxLink("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
Re: Problem with setWindowClosedCallback
Hi, can you provide more details about modal window implementation? Modal window behavior has changed a bit from version 1.4 to 1.5 Hi All, in wicket 1.4 i can make: AjaxButton searchButton = new AjaxButton("search")//{1} { @Override protected void onSubmit(AjaxRequestTarget target, Form ajaxForm) { window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { @Override public void onClose(AjaxRequestTarget onCloseTarget) { setResponsePage(new SearchPage(...))//{2} } }); window.close(target); } }; {searchButton} located on the modalPage which opened on {window}} But in wicket 1.5 this doesn't work. I tryed to move setWindowClosedCallback to constructor of the page - it works, but how can I set WindowClosedCallback directly before calling window.close(target) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-setWindowClosedCallback-tp3823361p3823361.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Problem with setWindowClosedCallback
Hi All, in wicket 1.4 i can make: AjaxButton searchButton = new AjaxButton("search")//{1} { @Override protected void onSubmit(AjaxRequestTarget target, Form ajaxForm) { window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { @Override public void onClose(AjaxRequestTarget onCloseTarget) { setResponsePage(new SearchPage(...))//{2} } }); window.close(target); } }; {searchButton} located on the modalPage which opened on {window}} But in wicket 1.5 this doesn't work. I tryed to move setWindowClosedCallback to constructor of the page - it works, but how can I set WindowClosedCallback directly before calling window.close(target) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-setWindowClosedCallback-tp3823361p3823361.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