pp108 : xforms-onrequest

xforms-onrequest


This event is fired before any request is sent by the model to the Application Service.

Event Information

To invoke

Send the request to the Application Service.

Default Action

Initiates any action associated with this event.

Named Script

xforms-onrequest


Event Object Properties

Property

Description

request

Object that denotes the request that is to be sent to the Application Service.

requestHeaders

Collection of SOAP headers that can be set on the request object. SOAP headers can be anything such as a SOAPAction, which contains the URI for the SOAP header, binding that denotes the type of data format sent to the request, and so on.



If the header of a request contains information to be sent with the request, the appropriate input UI is created to collect relevant inputs. Alternatively, you can specify the information using the request event object property of this event.

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

Remarks


This method can be used to change or set parameters for the request before sending it to Application Service.

Example


This sample code demonstrates how the method can be used.

function EmployeesModel_xformsonrequest(eventObject) 
{ 
   var request = eventObject.request; 
  //Change parameter in request 
   cordys.setTextContent(cordys.selectXMLNode(request,".//*[local-name()='EmployeeID']"),"1")   
   eventObject.request = request; 
  //Set a sample request header SOAPAction 
  eventObject.requestHeaders["SOAPAction"]="http://myserver/mysoaphandler" 
}

Applies to


Model