Window, Form, and Control Events

This section describes the events generated by user interaction with the application in some way, usually by the mouse or a keyboard action.

One action may generate multiple events for that process. For example, clicking a different form can cause the following events.

Other development platforms take the approach of causing some of these events when properties of the controls or forms are altered; for example, causing the change event when text in a TextBox control changes. JADE does not do this. Sometimes these pseudo-events are an advantage, but sometimes they cause difficulties, with extra logic required to ignore the event, particularly when initializing the data in the control.

Use the Window class enableEvent method to control at run time whether JADE logic associated with an event for a specific form or control is executed. You could use this method in thin client mode, for example, to speed up the data entry process for a TextBox control by disabling the keyDown event. (Event methods can be enabled or disabled in standard client mode and in thin client mode.)

In general, any events generated as a result of logic are not sent. The exception to this rule is that the following events are sent regardless of whether logic caused that event.

For details about the events that can be generated from JADE logic, see "Windows Events and JADE Events", in the following subsection.

When an event method defined at the Control class is deleted, the user is warned of this. If the deletion is confirmed, the event methods that correspond to this control event are also deleted.

Renaming a control event method automatically renames all event implementations.

Menu and control events have the menu or control causing the event passed as the first parameter. This need not be used if the event logic is designed only for a particular control. In this case, the logic can refer to the specific control. However, you should use the passed menu or control. By doing so, more than one control or menu can use the same event logic, where appropriate. In this situation, the event for these controls would have been mapped to the same method name.

Using the parameter is also of benefit when controls are cloned using the loadControl or addControl method. In this case, there is more than one control with the same name and type. They each share the same event methods. References to the control name directly from logic access only the original control created in the JADE development environment.

You can access all GUI properties and methods (which are marked as clientExecution methods) from a server method except for anything that brings up a modal-type dialog (that is, the common dialog class methods, the app.msgBox, and the showModal and popupMenu methods in the Form class). The other exceptions to this are the app.doWindowEvents, app.checkPictureFile, and app.loadPicture methods, which are executed relative to the server.

Use of GUI methods and properties is very expensive in a server method. A clientExecution method requires that all transient objects passed to the server are passed back with the client execution (and passed back to the server after the client execution is complete). Accessing GUI properties and methods within a server execution should therefore be done only in exceptional circumstances.