setEventMappingEx(eventMethod: Method; mappedMethod: Method);
The setEventMappingEx method of the Window class enables the method that is executed for an event in this window to be dynamically set at run time and the mapping cached on each JADE node. This method enables a form to be dynamically constructed and the event methods to be defined at run time.
Repeat calls for a mapping that has been previously used is recognized and the signature check is not repeated unless the timestamp of the mapped method has changed since the previous signature check. The cost of reloading a form that assigns event mappings is therefore subsequently less expensive on that node. If an application server is involved, only the first assignment by any user performs the signature check. Subsequent repeat calls for any user on that application server avoid that overhead.
The event method being mapped and the mapped method are passed as parameters. The underlying logic, therefore, does not have to find the methods by name, making the execution more efficient; for example:
btnAction.setEventMethodEx(Button: click, Dialog::myButtonClick);
This method is equivalent to the setEventMapping method but as it is more efficient, you should use the setEventMappingEx method to improve performance.
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;
The parameters of the setEventMappingEx method are listed in the following table.
Parameter | Description |
---|---|
eventMethod | Specifies the event method, which must belong to the class of the receiver of the setEventMappingEx call, and must be a defined event name for the form or control; for example, click. |
mappedMethod | The method that is to be called. This method must exist on the form that is the parent of the menu or control for which you are calling the setEventMappingEx method. |
The method checks that:
The event method is valid for the window
The method to be called exists
The signature of the method matches the event method signature