e-Form Scripting Guide
Learn scripting concepts and basic knowledge
Last updated
Was this helpful?
Learn scripting concepts and basic knowledge
Last updated
Was this helpful?
Components raise various events at runtime according to their component type and processing steps.
Write scripts in events.
When an event is raised at runtime, the event script is executed.
e-Form API methods are used in the event script to control appearances and behaviors at runtime.
Report event ( Rendering components / Binding data )
Events that are raised during the process of opening e-Form - starting and initializing the e-Form template, rendering components, and binding component with data,
OnStartUp, OnInitialize, OnStartBind, OnBind, OnEndBind, etc.
e-Form event ( Value change / User action )
Events that are raised when the user has changed the value of the input components or has done some action on the input components.
OnClick, OnValueChanged, OnFocus, OnCheckValidity, etc.
Key events by component
OnStartUp
Put viewer parameters to control component properties
OnInitialize
Component created
OnStartBind
Binding began
OnBind
Get data, bind it to component, set properties
OnEndBind
Get the page number, Get the component value.
OnFocus
Get focus
OnValueChanged
Data input or change
OnKillFocus
Loose focus
Functions
Contain global functions
OnCheckValidity
Form input validtion logic
Use help tooltip
Tab size
Select a Component and Event
Name and FormID must be unique.
The default name consists of a component type and serial number.
Cannot contain the dot(.) character.
Used for some Input features (ex: make Lable work as Textbox)
Required for DialogueFlow
Allow dot(".") characters to represent array items (parent and child)
Take precedence over Name.
The reserved word This references the current component object.
When typing in "This.", available functions for the chosen event are listed.
Get the object of other components by its Name.
Get the object of other Input components by FormID or Name (FormID takes precedence)
Not specific to any event and can be used globally
Start with an underscore('_').
Frequently used methods for debug:
_MessageBox
_TraceLn
Control property or data
Frequently used methods:
GetComponentByName
GetInputComponent
GetText
SetText
GetInputValue
SetInputValue
SetChecked
IsChecked
SetEnable
SetVisible
GetDatasetValue
Viewer parameters control e-Form rendering options or viewer features.
Viewer parameters can be set both in the e-Form or from the application (HTML)
Set the default or invariable parameter values in the e-Form
Variable parameter values can be set from the application (HTML).
Use SetReportOption() in OnStartUp event of the ReportTemplate component.
Right-click the ReportTemplate.
Choose Preview Script.
Point anywhere on your e-Form opened by previewing or by the application.
Hit the shortcut key <Ctrl+Shift+Z>.
Information
General information such as product versions
Debug
Debugging information such as Viewer execution environments and tracing log messages by _TraceLn() function.
Error
Errors occurred while running the e-Form.
All
Above all information is merged in the tab