Hi Martin,

> start?!

for me it wouldn't be clear whether "/ajax/call/start" comes before or after "/ajax/call/before".

"/ajax/call/init" should convey something like a constructor event, i.e. the very first callback.

Thanks
Sven


On 11.05.2015 14:02, Martin Grigorov wrote:
Hi,

On Mon, May 11, 2015 at 2:43 PM, 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?

start?!


Regards
Sven


Reply via email to