Cancel Partial Refresh via CSJS
/***
 *** Cancel Partial Refresh via CSJS
 ***
 *** Has to be embedded in CSJS-Scriptblock
 ***/

var xhrCall = null;

dojo.addOnLoad( function(){

   /*** hijack dojo's xhrRequest ***/
   dojo._xhrPost = dojo.xhrPost;
   dojo._xhrGet = dojo.xhrGet;

   dojo.xhrPost = function( args ){
      xhrCall = dojo._xhrPost( args );
   }

   dojo.xhrGet = function( args ){
      xhrCall = dojo._xhrGet( args );
   }
});

/*** Cancel Partial Refresh ***/
xhrCall.cancel()





Example how to cancel a partial refresh by hijacking dojo.xhr-Requests.

To prevent partial refresh error message from XSP-object you have to add your own error handler, f.e.
XSP.partialRefreshGet('id', { onError: function(){} } );

An explanation can be found here: http://hasselba.ch/blog/?p=386

JavaScript (Client)
Sven Hasselbach
Rating
7

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.







No comments yetLogin first to comment...