xpages - How can you report or display an error from an XSP.partialRefreshPost call -


I am using custom event handlers for many parts of our application. Tim Tranquin describes this ... he will most likely answer (hopefully) ...

Event handlers in my code look like this:

  & Lt; Xp: EventHandler id = "newbsDoSomething" submit = "true" event = "invitedbyid" Refresh mode = "full"> & Lt; XP: this.action & gt; ! & Lt; [CDATA [# {Javascript: doSomethingFromSomewhere ();}]] & gt; & Lt; / XP: this.action & gt; & Lt; / XP: eventhandler & gt;   

Buttons or other controls execute these events with the code that looks like this:

  XSP.partialRefreshPost (("# {id : NewbsDoSomething} "{Params: {'$$ xspsubmitvalue': 'Something that tells what to do.'}, But error: function (mistake) {Warning ('Anybody doing this method gets an error Is ... '); // I want to report error here}, complete: function () {// maybe anything else}}});   

when I make a mistake (blue once In the Moon) and in response to the AJAX request there is a stack trace. I want to put a button which alternatively presents the stack trace in the second page.

The mistake in On Arctic method is undefined, That's why he is not helping. I will not see any property of XSP object, which will be a response. I can see the feedback in the firebug console, but I think it is practical How do I get it?

/ newbs

The problem is that the CSJS function XSP ._ partial refresh checks whether onError -permit is a function or if it is a function, then it needs the necessary parameters / O is called.

But if you use string instead, eval is done with it, so it is possible to do something like this:

  function myErrHandler () {// just doing some debugging / var arg = arguments of ioArgs object [1]; Var txt = ""; For (pg in arg) {txt + = p + "- & gt;" + Arg [p] + "[" + type (arg [p]) + "] \ n"; } Warning (txt); } XSP.partialRefreshPost ("# {id: newbsDoSomething}", {onreror: 'myErrHandler (argument [0], argument [1])'});   

Hope this helps

Sven

Comments