Try OpenEdge Now
skip to main content
Online Help
Introducing the ABL GUI Designer : Tasks : Working with the code : Adding triggers
 
Adding triggers
The Add Trigger dialog helps you to associate an event (also called as a trigger) with an object in the AppBuilder (.w) file. An event is an action associated with a trigger and on an object.
Note: The Add Trigger option is available only with the AppBuilder (.w ) files.
To add trigger for an object:
1. Open the .w procedure file in the ABL Editor.
2. Open the Add Trigger dialog by doing one of the following:
*From the Source menu, select Add Trigger.
*From the right-click context menu, select Source > Add Trigger.
The Add Trigger dialog appears.
3. From the Widget drop-down, select an object. This drop-down contains all the objects that are present in the current design window.
4. From the Event category drop-down, select an event category. For details on the event categories, see Add Trigger dialog.
5. If you select an event category other than Keyboard Event from the Event category drop-down, go to step 6. If you select Keyboard Events as the event category, follow these steps:
a. In the Key label field, enter a label for the keyboard event such as F1 or F2.
b. The Key function displays the pre-defined function associated with the key label such as Help for F1 or GO for F2. If there is no pre-defined function associated with the Key label, then the same key label text is displayed in the Key function field.
c. For the Generate code by option, select either Key Function or Key label.
d. Go to step 7.
6. From the Event drop-down, select an event. This drop-down contains all the events based on the object and event category you have selected.
7. Click Generate.
The ABL Editor inserts the trigger code for the selected object in the (.w) procedure file.