ExecuteFormFieldScriptJSON

Formularios, seguridad de JavaScript

Descripción

Ejecuta una acción de validación, cálculo, formato o tecleo de un campo y devuelve el resultado y el estado del evento como JSON. Expone ExecuteFormFieldScriptEvent a las interfaces DLL y ActiveX

Sintaxis

Delphi

Function TPDFlib.ExecuteFormFieldScriptJSON(Index, Action: Integer; Const Value, Change: WideString; SelStart, SelEnd, Flags: Integer): WideString;

ActiveX

Function PDFlib::ExecuteFormFieldScriptJSON(Index As Long, Action As Long, InputValue As String, Change As String, SelStart As Long, SelEnd As Long, Flags As Long) As String

Disponible en IPDFlibrary4 desde la versión 3.5 del type library

DLL

const wchar_t* DLExecuteFormFieldScriptJSON(int InstanceID, int Index, int Action, const wchar_t* Value, const wchar_t* Change, int SelStart, int SelEnd, int Flags);
const char* DLExecuteFormFieldScriptJSONA(int InstanceID, int Index, int Action, const char* Value, const char* Change, int SelStart, int SelEnd, int Flags);

Parámetros

IndexEl índice de campo basado en 1
Action0 validate, 1 calculate, 2 format o 3 keystroke
Value, ChangeEl event.value y event.change iniciales
SelStart, SelEndLa selección que el cambio reemplaza
FlagsSuma de 1 willCommit, 2 fieldFull, 4 keyDown, 8 modifier y 16 shift

Valores devueltos

Un objeto JSON con result (el valor de retorno de ExecuteFormFieldScriptEvent), value, change, rc, selStart y selEnd; un Action inválido devuelve {"result":0} con LastErrorCode 708

El campo de origen es el campo objetivo. Las cadenas de la DLL pertenecen al buffer de retorno de la instancia y deben copiarse antes de la siguiente llamada

Véase también

ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics