OnAction
Forms, interaction
Description
TPDFlibFormSession
TPDFlibActionInfo
/Fo is about to honor an available Widget action
The callback receives the Widget index, the single-character PDF trigger event and a typed /Bl describing the configured action, which is looked up on the Widget first and on its base field when the Widget itself carries no action
Triggers observed through this callback include /K and /V on focus transitions, /F on selection edits and choice changes, /E and /X during commits and /D, /U,
Allow and False during pointer interaction
The callback fires only when an action is actually configured, and setting
Declaration
property OnAction: TPDFlibFormSessionActionEvent;
Handler parameters
| Sender | Session that dispatched the action |
|---|---|
| FieldIndex | Field or temporary Widget index the action belongs to |
| TriggerEvent | PDF trigger event name, such as 'Fo', 'Bl', 'K', 'V', 'F', 'E', 'X', 'D' or 'U' |
| ActionInfo | Typed description of the configured action |
| Allow | Veto flag, preset to True and set to False to reject the pending operation |
Example
procedure TForm1.SessionAction(Sender: TObject; FieldIndex: Integer;
const TriggerEvent: AnsiString; const ActionInfo: TPDFlibActionInfo;
var Allow: Boolean);
begin
if TriggerEvent = 'V' then
Allow := ValidateBeforeCommit(FieldIndex);
end;
See also
DispatchAction, TPDFlibActionInfo, OnFocusChanged, OnTextEdit, OnValueChanged, ExecuteFormFieldScript