Table of Contents

TTMSFNCDataBinder Class

Binds one or more component properties to dataset fields, synchronising UI controls with live data.

API unit family: TMSFNCDataBinding Inherits from: TTMSFNCCustomComponent

Syntax

TTMSFNCDataBinder = class(TTMSFNCCustomComponent)

Properties

Name Description
Active When True, data binding is active and all items synchronise with the dataset. Default is False.
DataSource Default data source used by binding items that do not specify their own data source.
ItemByName Returns the binding item whose Name matches AName, or nil if not found.
ItemByObject Returns the binding item for the given bound object and property name, or nil if not found.
Items Collection of individual binding items, each mapping a component property to a dataset field.
Version Component version string.

Methods

Name Description
BeginUpdate Suspends data synchronisation; call EndUpdate to resume.
BitmapToBlobField Saves the specified bitmap into a BLOB field.
BlobFieldToBitmap Loads a BLOB field value into the specified bitmap.
Connect Creates a binding item using explicit parameters; a convenience alternative to configuring an TTMSFNCDataBinderItem manually.
ConnectColumnList Creates a column-list binding that populates both column headers and list items from the dataset.
ConnectGrid Creates a grid binding that maps all dataset columns to a grid component.
ConnectList Creates a list binding from multiple dataset fields to component sub-properties.
ConnectListHTMLTemplate Creates a list binding using HTML templates for multiple sub-properties.
ConnectSingle Creates a single-value binding from one dataset field to a component property.
ConnectSingleHTMLTemplate Creates a single-value HTML template binding from the data source to a component property.
EndUpdate Resumes data synchronisation after a BeginUpdate call.
GetDataSources Fills AStrings with the names of all data sources referenced by active binding items.
GetPropertyList Returns the list of published RTTI properties for the given object.
GetPropertyNames Returns an array of property names for the given object.
HasControlValueMonitor Returns True if a control-value monitor is registered for the specified object.
HasEditLinkMonitor Returns True if an edit-link monitor is registered for the specified object.
IsConnected Tests whether the specified object has an active binding item.
ItemCount Returns the number of binding items in Items.
NotifyEdit Notifies all active binding items that the current record has entered edit mode.
NotifyPost Notifies all active binding items that the current record has been posted.
NotifySetActiveRecord Notifies all active binding items that the active record has changed.
NotifyUpdate Notifies all active binding items that data has been updated from the dataset.
NotifyValueChanged Notifies all active binding items that a bound control value has changed.
StartEditor Opens the design-time binding editor for the specified bound object, or for all bound objects if AObject is nil.

Events

Name Description
OnAfterWriteFieldToProperty Fires after a dataset field value has been written to a component property.
OnAfterWriteHTMLTemplateToProperty Fires after an HTML template has been applied to a component property.
OnAfterWritePropertyToField Fires after a component property value has been written back to a dataset field.
OnBeforeWriteFieldToProperty Fires before a dataset field value is written to a component property; set AAllow to False to suppress the write.
OnBeforeWriteHTMLTemplateToProperty Fires before an HTML template is applied to a component property; set AAllow to False to suppress or modify the template.
OnBeforeWritePropertyToField Fires before a component property value is written back to a dataset field; set AAllow to False to suppress the write.

Used by