0

I have implemented the partial refresh dialog control xsnippet you can find here: http://openntf.org/XSnippets.nsf/snippet.xsp?id=bootstrap-standby-dialog

For the cancel button I have altered the operation:

button onClick="StandbyDlg.StandbyDialog_Completed();xhrCall.cancel();

So it should also abort the partial refresh operation.

I notice I am getting errors now, which is to be expected as described here.

Unfortunately I have problems understanding the suggested solution ("To solve this you have to add a custom error handler to your refresh, f.e.").

Where and how should I add that in the xsnippet?

Patrick Kwinten
  • 1,988
  • 2
  • 14
  • 26

2 Answers2

1

If a partial refresh fails, because of a timeout or an error, a message box will occur with the partial refresh id which has failed, and an error message.

If you want to override this behaviour, you have to add the parameter onError to your partial refresh containing a callback function which is called when the partial refresh fails.

Another way is to set the parameter failOk to the hijacked xhrGet and xhrPost function calls:

dojo.xhrPost = function( args ){
   args['failOk'] = true;
   xhrCall = dojo._xhrPost( args );
 }

dojo.xhrGet = function( args ){
    args['failOk'] = true;
    xhrCall = dojo._xhrGet( args );
}

This prevents error messages for all xhr Calls.

Sven Hasselbach
  • 10,455
  • 1
  • 18
  • 26
0

If you have a standard custom control that you use on all pages, you can add the code there. One of the components available but not shown by default in the palette is the Output Script control (xp:scriptBlock). You can drag that onto the page and it will allow youo to code CSJS directly on the page. So you can add that snippet to the Output Script control. Here's an example of an Ouput Script block with a dojo.addOnLoad() call - Setting viewScope onLoad and onResize.

Community
  • 1
  • 1
Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33