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

SenderSession that dispatched the action
FieldIndexField or temporary Widget index the action belongs to
TriggerEventPDF trigger event name, such as 'Fo', 'Bl', 'K', 'V', 'F', 'E', 'X', 'D' or 'U'
ActionInfoTyped description of the configured action
AllowVeto 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