Configure an event handler script
- Last UpdatedDec 06, 2024
- 3 minute read
When you add an Event Handler script and select the script name from the list of scripts on the Script tab, the app name, event, and parameters associated with the event are shown in a grid at the top of the page, above the script editing area.

|
|
App/Control Name |
|
|
Event Name |
|
|
Parameter Grid |
|
|
Script Editing Area |
In the parameter grid, you can change the order in which the parameters are shown by clicking on either of the column headers. Parameters can be shown in ascending or descending order by name or type.
All public events, methods, and .NET dependency properties are exposed for apps that are compiled against the current version of the SDK. If an app was compiled against a previously released version of the SDK, only .NET dependency properties are exposed.
When you create an Event Handler script, the event name appears in bold in the list of available events.
To configure an event handler script
-
To change a parameter name, select its name in the parameter grid and enter a new name.
-
Enter your script in the main edit box. You can directly access properties and methods that belong to the app/control, without using the MyContent namespace .Autocomplete helps by displaying valid items, based on the initial characters you enter.
-
You can validate your script for syntax errors prior to saving by pressing the Validate Script
button.
-
To clear all data entered for the the script, including the expression, press the Clear Script
button. There is no undo for this action.
-
-
To save the script, select the Save
or Save and Close
button.
-
The script is validated automatically. If there are warnings or errors generated, a dialog listing the errors is displayed. You have the following options:
-
Select Yes to save the script and preserve the errors.
-
Select No to discard the changes you made to the script. If you selected Save and Close, the Layout editor closes and you will lose any changes you made to the script. If you selected Save, the Layout Editor remains open and you can resume editing the script.
-
Select Cancel to resume editing the script. The Layout Editor remains open and you can resume editing the script.
-
Event handler script limitations
The events for existing custom apps that were compiled against an older version of the AVEVA OMI SDK are filtered, and only .NET dependency properties will be exposed for event scripting. This ensures that public properties that may not have been intended to be used for scripting cannot be used this way.
Do not create event handlers for events that occur during, or shortly after, the creation of the app instance or short. For example, do not create an event handler for the "Initialized" event.
Do not create event handlers for touch events. These will not be executed at runtime.



