how to call modal window on link
Hi, is it possible to call modal window on simple link without Ajax Request? public void onClick() { } Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882.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: how to call modal window on link
http://stackoverflow.com/questions/4765790/how-to-open-modaldialog-on-pageload and https://cwiki.apache.org/confluence/display/WICKET/Modal+Windows Hope it still works as it did a few years ago! On Wed, Oct 26, 2016 at 3:15 PM, Pratibha wrote: > Hi, > > is it possible to call modal window on simple link without Ajax Request? > public void onClick() { > } > > Thanks > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/how-to-call-modal-window-on-link-tp4675882.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 > > -- Regards - Ernesto Reinaldo Barreiro
Re: how to call modal window on link
Hi thank you for your help but the below lines in OpenWindowOnLoadBehavior seems to be creating issue @Override public void renderHead(IHeaderResponse response) { response.renderOnLoadJavascript(getCallbackScript().toString()); } I followed code in http://stackoverflow.com/questions/4765790/how-to-open-modaldialog-on-pageload. I cant get it working :(. Please advise. Thank you. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675903.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: how to call modal window on link
On Thu, Oct 27, 2016 at 1:41 PM, Pratibha wrote: > Hi thank you for your help but the below lines in OpenWindowOnLoadBehavior > seems to be creating issue > What kind of issue ? > > @Override > public void renderHead(IHeaderResponse response) { > response.renderOnLoadJavascript(getCallbackScript().toString()); > } > > I followed code in > http://stackoverflow.com/questions/4765790/how-to-open- > modaldialog-on-pageload. > > I cant get it working :(. Please advise. > > Thank you. > > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675903.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: how to call modal window on link
Compile error..The method renderOnLoadJavascript(String) is undefined for the type IHeaderResponse public class OpenWindowOnLoadBehavior extends AbstractDefaultAjaxBehavior { @Override protected void respond(AjaxRequestTarget target) { ModalWindow window = (ModalWindow) getComponent(); window.show(target); } @Override public void renderHead(final Component component, IHeaderResponse response) { //*response.renderOnLoadJavascript(getCallbackScript().toString());* } } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675906.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: how to call modal window on link
I am trying to call modal window but this is not working my code is @Override public void onClick() { confirmModal.add(new OpenWindowOnLoadBehavior()); confirmModal.setPageCreator(new ModalWindow.PageCreator() { @Override public Page createPage() { return new RedirectPage("http://www.google.com";); } }); } public class OpenWindowOnLoadBehavior extends AbstractDefaultAjaxBehavior { @Override protected void respond(AjaxRequestTarget target) { ModalWindow window = (ModalWindow) getComponent(); window.show(target); } @Override public void renderHead(final Component component, IHeaderResponse response) { *response.renderOnLoadJavascript(getCallbackScript().toString());* } Please help me with this. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675907.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: how to call modal window on link
response.render(OnLoadHeaderItem.forScript(getCallbackScript().toString()); Should be something like this. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Oct 27, 2016 at 2:08 PM, Pratibha wrote: > I am trying to call modal window but this is not working my code is > > @Override > public void onClick() { > > confirmModal.add(new > OpenWindowOnLoadBehavior()); > confirmModal.setPageCreator(new > ModalWindow.PageCreator() { > @Override > public Page createPage() { > return new RedirectPage("http://www.google.com";); > } > }); > } > > public class OpenWindowOnLoadBehavior extends AbstractDefaultAjaxBehavior { > @Override > protected void respond(AjaxRequestTarget target) { > ModalWindow window = (ModalWindow) getComponent(); > window.show(target); > } > @Override > public void renderHead(final Component component, IHeaderResponse > response) { > > *response.renderOnLoadJavascript(getCallbackScript().toString());* > } > > Please help me with this. > > Thanks > > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675907.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: how to call modal window on link
Thank you that seems to be working but when i click on link it first opens the same page in new tab and after that i can see modalWindow. So basically i end up with 2 same pages in 2 tabs one with modalwindow. confirmModal.add(new OpenWindowOnLoadBehavior()); confirmModal.setContent(new ComplaintModal(confirmModal.getContentId(),confirmModal,_form)); I need modalwindow to be opened in same page on button click. Thank you so much... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675913.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: how to call modal window on link
checked that you don't target="_blank" on that link. On Thu, Oct 27, 2016 at 2:40 PM, Pratibha wrote: > Thank you that seems to be working but when i click on link it first opens > the same page in new tab and after that i can see modalWindow. > > So basically i end up with 2 same pages in 2 tabs one with modalwindow. > > confirmModal.add(new OpenWindowOnLoadBehavior()); > confirmModal.setContent(new > ComplaintModal(confirmModal.getContentId(),confirmModal,_form)); > > I need modalwindow to be opened in same page on button click. > > Thank you so much... > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675913.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 > > -- Regards - Ernesto Reinaldo Barreiro
Re: how to call modal window on link
That seems to be working ok but when i close modalwindow it again Loads page is it possible to use response.render(OnEventHeaderItem.forScript(getCallbackScript().toString())); instead of OnloadHeaderItem Thank you -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675966.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: how to call modal window on link
Thank you i tried this,it does not seem to be doing anything i want to call modal window on link click. am i missing something? response.render(OnEventHeaderItem.forScript("'" + component.getMarkupId()+ "'", "onclick", getCallbackScript())); Please advise. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675972.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: how to call modal window on link
"onclick" is not a valid JS event name Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Oct 31, 2016 at 2:51 PM, Pratibha wrote: > Thank you i tried this,it does not seem to be doing anything i want to call > modal window on link click. am i missing something? > > response.render(OnEventHeaderItem.forScript("'" + > component.getMarkupId()+ > "'", "onclick", getCallbackScript())); > > Please advise. > > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675972.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: how to call modal window on link
On Mon, Oct 31, 2016 at 2:35 PM, Pratibha wrote: > That seems to be working ok but when i close modalwindow it again Loads > page > > is it possible to use > response.render(OnEventHeaderItem.forScript(getCallbackScript().toString() > )); > OnLoadHeaderItem just does: window.onload So yes, you could use OnEventHeaderItem.forScript() with any better event. > > instead of OnloadHeaderItem > > Thank you > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675966.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: how to call modal window on link
please advise which event i should use on link click then? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675974.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: how to call modal window on link
click Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Oct 31, 2016 at 3:00 PM, Pratibha wrote: > please advise which event i should use on link click then? > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675974.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: how to call modal window on link
I tried that its not working, not sure what i am missing. @Override public void onClick() { confirmModal.add(new OpenWindowOnLoadBehavior()); } public class OpenWindowOnLoadBehavior extends AbstractDefaultAjaxBehavior { @Override protected void respond(AjaxRequestTarget target) { ModalWindow window = (ModalWindow) getComponent(); window.show(target); } @Override public void renderHead(final Component component, IHeaderResponse response) { super.renderHead(component, response); response.render(OnEventHeaderItem.forScript("'" + component.getMarkupId()+ "'","click", getCallbackScript())); } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675977.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: how to call modal window on link
Check for JavaScript errors. "it's not working" doesn't tell us much to be able to help you Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Mon, Oct 31, 2016 at 3:11 PM, Pratibha wrote: > I tried that its not working, not sure what i am missing. > > @Override > public void onClick() { > confirmModal.add(new OpenWindowOnLoadBehavior()); > } > > public class OpenWindowOnLoadBehavior extends AbstractDefaultAjaxBehavior { > @Override > protected void respond(AjaxRequestTarget target) { > ModalWindow window = (ModalWindow) getComponent(); > window.show(target); > } > @Override > public void renderHead(final Component component, IHeaderResponse > response) { > super.renderHead(component, response); > response.render(OnEventHeaderItem.forScript("'" + > component.getMarkupId()+ > "'","click", getCallbackScript())); > } > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/how-to-call-modal-window-on-link-tp4675882p4675977.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 > >