LiveBindings and Action Lists
Go Up to LiveBindings in RAD Studio
LiveBindings supports integration with Action Lists. This means that the menu that contains all the standard actions now also contains standard LiveBindings actions.
Overview
The LiveBindings actions can be used if you first place a TActionList component on a form (VCL or FMX). You can assign to buttons and menus standard LiveBindings actions using the Object Inspector, where you have the Action
property published.
As you can see in the previous image, the standard LiveBindings actions are similar to the functions that the Bind Navigator (VCL, FMX) offers.
Button | Purpose |
---|---|
TBindNavigateFirst | Sets the current record to the first record in the data source, disables the First and Prior buttons, and enables the Next and Last buttons, if they are disabled. |
TBindNavigatePrior | Sets the current record to the previous record and enables the Last and Next buttons, if they are disabled. |
TBindNavigateNext | Sets the current record to the next record and enables the First and Prior buttons, if they are disabled. |
TBindNavigateLast | Sets the current record to the last record in the data source, disables the Last and Next buttons, and enables the First and Prior buttons, if they are disabled. |
TBindNavigateInsert | Inserts a new record before the current record and sets the data source into Insert and Edit states. |
TBindNavigateDelete | Deletes the current record and makes the next record the current record. |
TBindNavigateEdit | Puts the data source into Edit state so that the current record can be modified. |
TBindNavigatePost | Writes changes in the current record to the data source. |
TBindNavigateCancel | Cancels edits to the current record, restores the record display to its condition prior to editing, and turns off the Insert and Edit states, if they are active. |
TBindNavigateRefresh | Refreshes the buffered data in the associated data source. |
TBindNavigateApplyUpdates | Applies all pending updates to the data source. |
TBindNavigateCancelUpdates | Cancels all pending updates to the data source. |
Using LiveBindings Standard Actions
The LiveBindings actions can be assigned to toolbar buttons, speed buttons, bitmap buttons, standard buttons, and menu items.
Follow these steps in order to assign a LiveBindings action to some buttons to emulate the functionality of a binding navigator (VCL, FMX).
- Start by creating a VCL Forms Application (FMX is also supported, but no TImageList component is available for FMX).
- Drop a TActionList component on the form.
- Drop a TImageList component on the form.
- Drop three TBitBtn components on the form.
- Click the first button and go to the Object Inspector, locate the
Action
property, and select New Standard Action