use of de.agilecoders.wicket.jquery.function.JavaScriptInlineFunction in project syncope by apache.
the class IndicatingOnConfirmAjaxLink method renderHead.
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
if (enabled) {
response.render(JavaScriptHeaderItem.forScript("proceed = false;", null));
response.render($(this).on("click", new JavaScriptInlineFunction("" + "var element = $(this);" + "evt.preventDefault();" + "if (proceed == false) {" + " evt.stopImmediatePropagation();" + " bootbox.confirm('" + new ResourceModel(msg).getObject() + "', function(result) {" + " if (result == true) {" + " proceed = true;" + " element.click();" + " } else {" + " proceed = false;" + " }" + " return true;" + " })" + "} else {" + " proceed = false;" + "};", new ArrayList<>())).asDomReadyScript());
}
}
Aggregations