I use a non-intrusive javascript snipplet which requires nothing else
from the server side and it works with or without Wicket...:

css:
#busy-symbol { position: absolute; top: 0px; left: 0px; margin: 0px;
width: 100%; z-index: 100000; background: url(../images/raster.png)
repeat; cursor: wait; }
#busy-symbol div { font-size: 18px; width: 100px; background: #f8f8f8;
font-weight: bold; color: orange; text-decoration: blink; z-index:
100000; text-align: center; margin: 50% auto auto auto; }


<wicket:head>
        <script type="text/javascript">
<!--
  window.onload = setupFunc;

  var busySymbol;

  function setupFunc() {
    document.getElementsByTagName('body')[0].onclick = clickFunc;
    hideBusysign();
    Wicket.Ajax.registerPreCallHandler(showBusysign);
    Wicket.Ajax.registerPostCallHandler(hideBusysign);
    Wicket.Ajax.registerFailureHandler(hideBusysign);
  }

  function hideBusysign() {
    if (busySymbol != null) {
      busySymbol.parentNode.removeChild(busySymbol);
      busySymbol = null;
    }
  }

  function showBusysign() {
    if (!document.getElementById('busy-symbol')) {
      busySymbol = document.createElement('div');
      busySymbol.id = 'busy-symbol';

      var pageHeight;

      if ((window.innerHeight != null) && (window.scrollMaxY != null))
{ // Firefox
        pageHeight = window.innerHeight + window.scrollMaxY;
      } else if (document.body.scrollHeight >
document.body.offsetHeight) { // all but Explorer Mac
        pageHeight = document.body.scrollHeight;
      } else if (document.height != undefined) {
        pageHeight = document.height;
      } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
        pageHeight = document.body.offsetHeight + document.body.offsetTop;
      }

      {
        var busyLabel  = document.createElement('div');
        busyLabel.innerHTML = 'Loading ...';
        busySymbol.appendChild(busyLabel);
      }

      document.body.appendChild(busySymbol);

      busySymbol.style.height = pageHeight + 'px';
    }
  }

  function clickFunc(eventData) {
    var clickedElement = (window.event) ? event.srcElement : eventData.target;

    if ((clickedElement.tagName.toUpperCase() == 'A'
          && (clickedElement.href.lastIndexOf('#') !=
(clickedElement.href.length-1))
          && (clickedElement.href.indexOf('WicketAjaxDebug') < 0)
          && (clickedElement.href.lastIndexOf('.doc') !=
(clickedElement.href.length-4))
          && (clickedElement.href.lastIndexOf('.csv') !=
(clickedElement.href.length-4))
          && (clickedElement.href.lastIndexOf('.xls') !=
(clickedElement.href.length-4))
          && ((clickedElement.onclick == null) ||
(clickedElement.onclick.toString().indexOf('window.open') <= 0))
          )
      || (clickedElement.parentNode.tagName.toUpperCase() == 'A'
          && (clickedElement.parentNode.href.lastIndexOf('#') !=
(clickedElement.parentNode.href.length-1))
          && (clickedElement.parentNode.href.lastIndexOf('.doc') !=
(clickedElement.parentNode.href.length-4))
          && (clickedElement.parentNode.href.lastIndexOf('.csv') !=
(clickedElement.parentNode.href.length-4))
          && (clickedElement.parentNode.href.lastIndexOf('.xls') !=
(clickedElement.parentNode.href.length-4))
          && ((clickedElement.parentNode.onclick == null) ||
(clickedElement.parentNode.onclick.toString().indexOf('window.open')
<= 0))
          )
      || (
         ((clickedElement.onclick == null)
           || ((clickedElement.onclick.toString().indexOf('window') <= 0)
                && (clickedElement.onclick.toString().indexOf('confirm') <= 0)))
         && ((clickedElement.tagName.toUpperCase() == 'INPUT' ||
clickedElement.tagName.toUpperCase() == 'BUTTON')
             && (clickedElement.type.toUpperCase() == 'BUTTON'
                 || clickedElement.type.toUpperCase() == 'IMAGE'
                 || clickedElement.type.toUpperCase() == 'SUBMIT'))
         )
      ) {
      showBusysign();
    }
  }
-->
</script>
        </wicket:head>


**
Martin



2009/1/10 Kirk Is <[email protected]>:
> Could you share the code, or at least the core idea of how it hooks
> into a normal page/component, in the meanwhile
>
> On Fri, Jan 9, 2009 at 4:55 PM, Valentine2008
> <[email protected]> wrote:
>>
>> I created a reusable component, PanelWithAjaxBusyIndicatingMask, which
>> extends Panel.
>>
>> The functions it has:
>>
>> It will add a transparent mask layer to the current page to prevent further
>> UI interactivity when there are any busy Ajax activities.
>>
>> The mask layer will have an animation gif and a configurable display text
>> (the default is: Please wait…).
>>
>> Both the display text and the animation gif file are configurable in the
>> constructors.
>>
>> I am proposing it to the Wicket developers. Hope they will incorporate it
>> into the next release.
>>
>>
>> Kirk Israel-2 wrote:
>>>
>>> So one problem we've seen in a few places occurs when a (somewhat
>>> slow) request happens that refreshes the page or component, but then
>>> the user clicks on a link on the pre-refresh screen, and ends up
>>> getting a nasty exception thrown, since the component clicked on no
>>> longer "exists"
>>>
>>> Is there a single, easy workaround for this? Obviously you can try to
>>> limit the situations where this occurs, like my redrawing as little as
>>> possible, or otherwise making things less time consuming, but it still
>>> seems like it would be good if there was a general mechanism for
>>> ignoring inputs once some kind of Ajaxy-process is started...
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/generalized-way-to-ignore-mouse-input-during-screen-refresh--tp21379945p21381260.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to