you'll have to call #stopImmediatePropagation() to prevent AjaxLink from handling the "click" event.

Have fun

On 23.09.2015 14:17, Marco Di Sabatino Di Diodoro wrote:

I like to add a confirmation dialog to my application with Bootbox.js. To do this I created a new//ConfirmationModalBehavior (I haven taken ConfirmationBehavior from wicket-bootstrap as example) with

public void renderHead(final Component component, final IHeaderResponse response) {
        super.renderHead(component, response);

References.renderWithFilter(response, JavaScriptHeaderItem.forReference(new JQueryPluginResourceReference(
                ConfirmationModalBehavior.class, "bootbox.min.js")));

                new JavaScriptInlineFunction(""
                        + "evt.preventDefault();"
+ "bootbox.confirm(\"Are you sure?\", function (result) {"
                        +  "return true;" +
/and in my wicket page

final AjaxLink deleteLink = new AjaxLink("deleteLink", Model.of("Delete")) {

private static final long serialVersionUID = 3776750333491622263L;

            public void onClick(final AjaxRequestTarget target) {
                info("Invoked link's #onClick()!");

 deleteLink.add(new ConfirmationModalBehavior());

when I click on the AjaxLink, the confirm dialog is displayed after the execution of the onclick method. What's wrong?


To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to