xforms-onbeforesynchronize |
Event Information
To invoke |
Modify the data displayed in the UI, and click the Save button or call the synchronize() method of the model to synchronize the modifications with the backend. |
Default Action |
Appends the update requests in the request body, prepares the request, and initiates any action associated with this event. Sends the request to the back end based on the returnValue property set by the user on the event object. |
Named Script |
xforms-onbeforesynchronize |
Event Object Properties
Property |
Description |
---|---|
updateDocument |
Object that denotes the complete update document that is to be sent to the back end for synchronization. |
returnValue |
Boolean that denotes whether the data is to be synchronized with the back end or not.
|
removeAggregation |
Boolean that denotes whether the aggregated business elements (data or business elements that are part of a different business object) are to be removed or not, before synchronizing with the back end.
|
An event handler can access the event object and its properties through the eventObject available as a parameter on the handler.
Remarks
The xforms-onbeforesynchronize event applies only for models that have transactional data. For a non-transactional model, it does not apply.
Example
This sample code demonstrates how the method can be used.
function EmployeesModel_xformsonbeforesynchronize(eventObject) { //Confirm for saving from the user eventObject.returnValue = (confirm("Are you sure you want to synchronize the data to the backend?")); }