pp108 : xforms-before-data-bind

xforms-before-data-bind

This event is fired before the data is bound to the control.

Syntax

DesignTime

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

Event Information

To invoke

Create a model and associate it with any control and load the page.

Default Action

Initiates any action associated with the event.

Named Script

xforms-before-data-bind

Event Object Properties

Property

Description

businessObject

Object that denotes the business object to which the control is bound.

dataNode

Property that denotes the business element (XPath of the element inside the business object) containing the data bound to the HTML element. This property is null for a newly created business object.

returnValue

Boolean that denotes whether the data should be bounded to the control or not. To cancel the event, user can set the value of this property to false.

  • true: Default. Data should be bound to the control.
  • false: Data should not be bound to the control.

srcElement

Reference to the control.

oFormatType

Object. Format object that contains the dataType and other formatting attributes. This object must be retrieved using the getFormatType() method.

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

Example

This sample code demonstrates the event:

function onBeforeBind(eventObject)
{
 var data = cordys.getTextContent(eventObject.dataNode);
 //Check for data and if it is equal to 1, then return
 if (data == 1)
 {
 eventObject.returnValue = false;
 return false;
 }
}

Applies to

Input, Password, Output, Code Snippet, Textarea, Check, Radio, Select, List, Button