wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: Passing parameters from java code to global ajax call listeners
Date Fri, 26 Jul 2013 07:21:08 GMT
Hi,

You may mark any component with data-no-veil attribute.
Later you can check with: if ($(attrs.c).data("no-veil") !== null) {...}


On Fri, Jul 26, 2013 at 1:40 AM, Marios Skounakis <mscoon@gmail.com> wrote:

> Hi all,
>
> I am subscribing to the global ajax call listeners to show and hide a veil
> during ajax calls. The veil is displayed during all ajax calls. I want a
> way for some components / ajax behaviors to opt our from the veil.
>
> What I'm doing now is adding an extra parameter to the ajaxAttributes and I
> am checking for it in the beforeSend listener as shown in the code below.
>
> Is there a better way to handle this?
>
> -- setup
>
> Wicket.Event.subscribe('/ajax/call/beforeSend', function( attributes,
> jqXHR, settings ) {
>        showBusysign(jqXHR)
>         });
>    Wicket.Event.subscribe('/ajax/call/complete', function( attributes,
> jqXHR, textStatus) {
>        hideBusysign()
>         });
>
> -- showing the veil:
> function showBusysign(jqXHR) {
>      if(typeof jqXHR.ep != 'undefined') {
>          for (i=0; i<jqXHR.ep.length; i++) {if (jqXHR.ep[i].name =
> 'noveil') {return;}};
>      }
>     // go ahead and show the veil
>
> -- java code:
> @Override
> protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
>                 super.updateAjaxAttributes(attributes);
>                 attributes.getExtraParameters().put("noveil", "1");
>             }
>
>
> Thanks in advance,
> Marios
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message