It is rather hacky but by following down the stack I found a solution to this. Wicket treats the component's callback handlers privileged. If you are registering an IAjaxCallListener
, it will be allowed to return false
which is read by Wicket and what stops the propagation. The "global" event listeners are for some reason denied this privilege which is why the return value must be smuggeled into an not-yet existing array of precondition handlers. It's messy but it works.
Wicket.Event.subscribe('/ajax/call/before', function (jqEvent,
attributes,
jqXHR,
errorThrown,
textStatus) {
if (precondition) {
attributes.pre = [stopWicket];
}
}
});
function stopWicket() {
return false;
}
Anyways. who calls something a "precondition" but ignores the decision made on this precondition handler....