pp108 : xforms-insert

xforms-insert


This event is fired before inserting a new business object in the control that is before binding control to the XML data.

Event Information

To invoke

Insert a business object to the data by clicking on the Insert icon of the Control bar.

Default Action

Creates a new business object, creates the necessary UI, and initiates any action associated with this event.

Named Script

xforms-insert


Event Object Properties

Property

Description

businessObject

Object that denotes the new business object that is inserted in the Model.

model

Object that denotes the Model that fired the event.

srcElement

Object that denotes the business object that is inserted in the Model.

tuple

The tuple associated with the insert UI . This property is null for non-transactional models.



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

Remarks


This event applies for models that have both the transactional as well as non-transactional data.

This event is fired just after inserting the business object in the model. After this, the data is bound to all controls and views.

Example


This sample code demonstrates how the method can be used.

function EmployeesModel_xformsinsert(eventObject) 
{ 
   var busObject = eventObject.businessObject; 
   //Create ReportsTo node and append to business object 
   var reportsToNode = busObject.ownerDocument.createElement("ReportsTo"); 
   cordys.appendXMLNode(reportsToNode,busObject); 
   cordys.setTextContent(reportsToNode,"3"); 
}

Applies to


Model

Related reference

Control Bar