Hi,

You can use browser's online and offline events to be notified when
the network is down for some reason. See
http://stackoverflow.com/questions/3181080/how-to-detect-online-offline-event-cross-browser


On Fri, May 4, 2012 at 1:00 PM, Horacio Natyural
<horacio.natyu...@gmail.com> wrote:
> Hi,
>
> How do we catch network disconnection ?
>
> For example, I'm submitting using an indicatingajaxbutton, when the
> network is disconnected, the loading indicator disappears and the
> button is available again. Is there anyway that I can catch network
> disconnections in indicatingajaxbutton or any ajax button for that
> matter.
>
> I would like to post an alert warning to the client that he/she has
> been disconnected from the server.
>
> Is there anyway that I could insert something into this method?
>
> this is in wicket-ajax.js
>
> failure: function(message) {
>        if (message != null)
>            Wicket.Log.error("Wicket.Ajax.Call.failure: Error while
> parsing response: " + message);
>        this.request.done();
>        this.failureHandler();
>           Wicket.Ajax.invokePostCallHandlers();
>           Wicket.Ajax.invokeFailureHandlers();

You can register 'postCallHandler' and/or 'failureHandler' and this
method will call it/them for you.

>    }
>
> Thanks!
> Carlo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to