01.06.2013 Views

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

afterInvoke event<br />

afterInvoke event<br />

Fires after a non–built-in method is called asynchronously on a JSDO and a response<br />

to the request is received from the AppServer. Synchronous method calls do not cause<br />

this event to fire.<br />

Applies to: progress.data.JSDO class, invocation method<br />

The following parameters appear in the signature of the event handler function:<br />

Syntax<br />

function ( jsdo , success , request )<br />

jsdo<br />

success<br />

request<br />

A reference to the JSDO that invoked the method. For more information, see the<br />

description of the jsdo property of the request object.<br />

A Boolean that is true if the operation was successful. For more information, see<br />

the description of the success property of the request object.<br />

A reference to the request object returned after the operation completes. For more<br />

information, see the description of the request object.<br />

Example:<br />

myjsdo.subscribe('afterInvoke', 'myMethodName',<br />

onAfterInvokeMyMethodName);<br />

myjsdo.myMethodName( paramObject);<br />

function onAfterInvokeMyMethodName(jsdo , success , request )<br />

if (success) {<br />

var response = request.result.response;<br />

};<br />

var retval = response._retval;<br />

var myOutputParm = response.myOutParam;<br />

}<br />

else {<br />

if (request.response && request.response._errors &&<br />

request.response._errors.length > 0){<br />

var lenErrors = request.response._errors.length;<br />

for (var idxError=0; idxError < lenErrors; idxError++) {<br />

var errorEntry = request.response._errors[idxError];<br />

var errorMsg = errorEntry._errorMsg;<br />

var errorNum = errorEntry._errorNum;<br />

/* handle error */<br />

}<br />

}<br />

}<br />

See also: subscribe( ) method, unsubscribe( ) method<br />

188 <strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!