Simple Data Binding

Simple data binding refers to the relationship between a field in a recordset and the property of a WFC component. When a property is bound, data is automatically transferred between the field and the property:

Bindable Properties

Simple data binding in WFC is performed by the DataBinder component. This component creates and manages the binding between the field and the property. The DataBinder component can bind a property that is accessible through methods matching the following design patterns:

public <PropertyType> get<PropertyName>()
public void set<PropertyName>(<PropertyType>)

Note that if a property is also marked with BindableAttribute.YES in the component's ClassInfo, it is enumerated in the Properties window and in the DataBinder component's design page. (You can still bind a property that is not marked as bindable by manually typing the name in the Properties window or design page, or by binding the property programmatically.)

Property Change Notifications

The component of a bound property can provide a <propertyName>Changed event to indicate that the property's value has been changed. When this event is triggered, the DataBinder component marks the binding as dirty. Then when the user navigates to a new record or when the DataBinder.commitChanges method is called in code, the DataBinder component determines which bindings are dirty and updates those bindings on the recordset.

Note   If your component does not provide a <propertyName>Changed event for a property that is bound through the DataBinder component, the binding is read-only and your component will be disabled. To work around this limitation, you can manage the bindings yourself in code by directly reading from and writing to the recordset.