This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Dec 3, 2011, 3:43 AM
9 Posts
topic has been resolvedResolved

How to destroy/terminate xpages partial request?

  • Category: Dojo and Client Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: destroy terminate partial request
  • Replies: 3
When Browser is waiting to refresh a part of data (eg. using XSP.partialRefreshGet), how to destroy/terminate this request by client side? 
Dec 3, 2011, 1:24 PM
272 Posts
Re: How to destroy/terminate xpages partial request?
Hi,
 
Dojo provides a method to cancel an xhr-Request. The only problem is that XSP won't give you direct access to the underlying xhr-Object; that is why you can not cancel the request via the XSP object directly. Here is a workaround which hijacks Dojo. You have to add this in a script block.
 
var xhrCall = null;

dojo.addOnLoad( function(){
    dojo._xhrPost = dojo.xhrPost;
    dojo._xhrGet = dojo.xhrGet;

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

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

 
Now, you are able to cancel a running partial refresh with a simple
 
xhrCall.cancel();
 
Normally, an error will be raised by the XSP if a refresh is canceled. To solve this you have to add a custom error handler to your refresh, f.e.
 
XSP.partialRefreshGet('id', { onError: function(){} } );
 
Hope this helps
Sven
 
http://blog.hasselba.ch
Dec 6, 2011, 6:13 AM
9 Posts
Re: How to destroy/terminate xpages partial request?
Thanks solution
Dec 14, 2015, 9:32 AM
178 Posts
To solve this you have to add a custom error handler to your refresh, f.e. ??

I would like to use this code in the xsnippet for a responsive standby dialog. But I do not understand how to apply the " To solve this you have to add a custom error handler to your refresh, f.e." suggested solution. Can you provide some guidelines?


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal