Can we append script to show first a yes\no confirmation popup and then if user selects yes then proceed for the save logic
Note: i want confirmation popup within onsubmit of button
like
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
yes\no confirmation
depends on choice move for next logic ......
}
This wiki page shows some approaches to doing this with Wicket, for assorted versions.
EDIT:
For your need of deciding logic based on the response, something using panel replacement as in the last approach (labeled Without Javascript) on the page referenced above is likely best. There really is JavaScript involved in the panel replacement of course, but it’s all supplied by Wicket and not coded by you…
Basically, you change your submit link so that instead of submitting, it replaces a panel containing your form with a new panel for the confirmation decision, and in that panel you have cancel and confirm links that do different things.
Another possibility is the approach shown in this Wicket by Example article on ajax modal window confirms.