Product Information > JADE Encyclopaedia of Classes – Volume 3 > Chapter 2 - Window Classes > setEventMapping

setEventMapping

setEventMapping(eventName:  String;
                mappedName: String);

The setEventMapping method of the Window class and ActiveXControl class enables the method that is executed for an event in this window to be dynamically set at run time. This method enables a form to be dynamically constructed and the event methods to be defined at run time.

By default, the JADE development environment allows the definition of event methods for a form (event-name), and for controls on the form (control-name_event-name). For example:

bInvestors_click(btn: Button input) updating;

Using the Painter, this default mapping can be overridden by providing a specific method name to be executed when the event occurs. This method then provides the runtime ability to define the method to be called when the event occurs.

The parameters of the setEventMapping method are listed in the following table.

Parameter Description
eventName Must be a defined event name for the form or control; for example, click (case-dependent).
mappedName The name of the method that is to be called. This method must exist on the form that is the parent of the control for which you are calling the setEventMapping method or a method of the form that is calling the setEventMapping method.

The method checks that:

As this call is relatively expensive, you should use it sparingly.