PML Customisation User Guide

Form and Gadget Callbacks : PML Open Callbacks : Open Callbacks at Meta-events
However, the application software defines a set of meta-events for forms and gadgets. When a meta-event occurs, the application software checks for user-defined callbacks and executes them. Hence callbacks are the AppWare’s way of providing actions to be carried out at these meta-events.
!object is a Forms and Menus object, for example, a form, gadget or menu.
!action is the meta-event that occurred on the object and represents the action to be carried out by the method.
Note:
The open bracket '(', no arguments and no closing bracket. The callback is to an open method or function.
Note in the constructor method open() you have initialised the list so that field n will display list field n. DTEXT is a shorthand for display-text, that is the text displayed in the list field.
Note the use of the printing command $p to print information to the system Request channel. $!form replaces the variable !form with its current value as a string - this only works for PML simple in-built scalars types REAL, STRING, BOOLEAN. $n in $!form$n.$!name is a separator needed to separate $!form from the following ‘.’ which would otherwise be thought of as part of the variable name.
Inside the control() method you branch on the value of !action and access the data of !object (in this case our list). Finally you perform our application’s resultant action - in this case just printing out all you know about the operator interaction using the $p command, which for a selection of an un-highlighted list field will write:
Notice that the same method could be used to manage several or even all gadgets on our form since the variable !object is a reference to a gadget object and is supplied as !!Open.choose, the full name of the gadget including its form. This allows us to find everything about that object from its in-built methods, including its gadget type (LIST, TOGGLE, etc) and its owning form:

1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
AVEVA Logo