java - Wicket onsubmit information dialog -
i trying have wicket display information dialog after save button clicked invokes onsubmit has no access ajaxrequesttarget target. here code snippet
if (trainingmode() && !recorddecision.equalsignorecase("primary")) { if (trainingevalservice.comparedecisions(recorddecision, recordset.getrecordsetid())) { system.out.println("validity matchesmaserati: " + trainingevalservice.gettrainingeval().getactual_validity_decision_comment()); // dialog associated save button dialog = new messagedialog("dialog", "notice", "decision matches " + trainingevalservice.gettrainingeval().getactual_validity_decision_comment() , dialogbuttons.ok_cancel, dialogicon.warn) { public void onclose(ajaxrequesttarget target, dialogbutton button) { } }; dialog.open(target) // breaks here without reference ajaxtarget } else { } }
how can reference current ajaxrequesttarget?
two ways :
- if doing form submit through link, can add simpleattributemodifire it.
example :
yourlink.add(new simpleattributemodifier("onclick","alert('information')"));
this ll display javascript info, on can show information.
note : if not submitting link, can putting submit code in onsubmit() of submitlink.
- you can use modalwidow this, ll need ajax submit. can use ajaxsubmitlink that. can find modalwindow code here: http://www.wicket-library.com/wicket-examples-6.0.x/ajax/modal-window;jsessionid=2e08ec28b0c0a1ad3f8399628f048003?0