Hi, Right, you don't have any ART in onSubmit(), you should use an ajaxified component for this (AjaxButton, AjaxLink, etc) The typical usage of messagedialog, is to construct it during the page construction (it is hidden by default), attach it (!) and open it (dialog.open(target)) using the ajax component...
Check out the demo for inspiration... Hope this helps, Sebastien. On Mon, Apr 27, 2015 at 8:56 PM, smoothe19 <[email protected]> wrote: > protected void onSubmit() { > if (trainingmode()){ > AjaxRequestTarget target = > RequestCycle.get().find(AjaxRequestTarget.class); > > MessageDialog dialog = new MessageDialog("dialog", "Notice", > "Decision Matches " , > DialogButtons.OK_CANCEL, DialogIcon.WARN) { > > public void onClose( AjaxRequestTarget target, DialogButton > button) { > > } > }; > > dialog.open(target); > } > > get an error at dialog.open(target) that says : Caused by: > java.lang.NullPointerException at > > com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog.onOpen(MessageDialog.java:170) > at com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog.open(A > > I am trying to have an AjaxRequestTarget modal window pop up appear however > i do not have access to AjaxRequestTarget from within the onsubmit() > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Generating-a-popup-dialog-in-OnSubmit-tp4670521.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
