pp108 : xforms-beforeclose

xforms-beforeclose

This event is fired when the form is closed by the user.

Syntax

DesignTime

This is a design-time property and can be set through the property sheet of the control.

Event Information

To invoke

Close an XForm page.

Default Action

Closes an XForm page.

Named Script

xforms_before_close

Event Object Properties

Property

Description

returnValue

Boolean that denotes whether the form should close or not. To cancel the event, user can set the value of this property to false.

  • true: Default. Form should be closed.
  • false: Form should not be closed.

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 checks the status of the transaction object of a model in the page, and sets the return value to false:

function beforeCloseHandler(eventObject)
{
if (EmployeesModel.getTransactionState() == false) eventObject.returnValue = false;
}

The above code will not close the window, if the model in the page returned a SOAP fault while trying to synchronize.

Applies to

Form