With an additional Ajax topic like this is there any ordering risk (happens-before / happens-after) with regards to the regular Ajax updates?
N On Mon, May 11, 2015 at 7:43 AM, Sven Meier <[email protected]> wrote: > Hi all, > > I think I'm in need of a additional global ajax listener: > > Up till now I utilized a subscriber to "/ajax/call/before", to show a veil > on *all* button clicks. > > But now I realized, that under certain circumstances the veil is shown too > late: > If an Ajax request is already running (e.g. an > AjaxFormComponentUpdatingBehavior which does *not* show the veil), a > following double click on a button will schedule two ajax requests. > The first one will trigger the veil, but this is too late since the second > request is already scheduled :/. > > A new ajax topic will allow to solve this quite easily: > The event will be published before any throttling and/or scheduling, right > when the triggering event occurs. > > I will name the new topic "/ajax/call/init": > > Topic: { > ... > AJAX_CALL_INIT : '/ajax/call/init', > AJAX_CALL_BEFORE : '/ajax/call/before', > AJAX_CALL_PRECONDITION : '/ajax/call/precondition', > ... > } > > In Wicket 7/8 we could add IAjaxCallListener#onInitHandler(Component) too. > Any suggestions for a better name? > > Regards > Sven >
