pp108 : xforms-onresponse

xforms-onresponse

This event is fired when the model receives a response from the Application Service.

Event Information

To invoke

Receive a SOAP response from the Application Service

Default Action

Initiates any action associated with this event

Named Script

xforms-onresponse

Event Object Properties

Property

Description

httpStatusCode

String that denotes the HTTP status of a SOAP fault, when it occurs.

response

Object that contains the response XML received from the gateway.

returnValue

Boolean that denotes whether the response is stored in the model and the business object(s) is rendered. To cancel the event, user can set the value of this property to false.

  • true: Default. Model stores the response and the business Object(s) is rendered.
  • false: Model does not store the response and the business Object(s) is not rendered.

An event handler can access the event object and its properties through the eventObject available as a parameter on the handler.

Example

The function below sets the return value of the event object based on a value returned by the response of a model.

function responseHandler(eventObject)
{
 var response = eventObject.response;
 //Do not bind the response to the HTML, if the value in the response is not " John " .
 if(cordys.getTextContent(cordys.selectXMLNode(response,".//*[local-name()='tuple']/*[local-name()='new']/*[local-name()='FirstName']"))!= " John " )
 {
 eventObject.returnValue = false;
 }
}

Applies to

Model