Using the Event Handler Editor

How to:

Reference:

You define event handlers for specific events using the Event Handler editor.

Here is a brief overview of how to define events:

  1. Open the Event Handler editor. (See How to Open the Event Handler Editor.)
  2. Select a control or a form.
  3. Select an event that happens to that form or control (for example, Click).
  4. Select the action that occurs. The editor offers six choices:

Top of page

x
Procedure: How to Open the Event Handler Editor

To open the Event Handler editor, do one of the following:


Top of page

x
Reference: Event Handler Editor

The Event Handler editor is where you define the event handlers that are invoked when events occur in your application.

Event Handler Editor image

This editor has the following:

List of controls

Contains the controls on the form, as well as the form itself. One of these controls will already be selected when you open the Event Handler editor, but you can select another one if you wish.

List of events

Contains the possible events that can happen to the control or form you selected. For a description of these events, see Events.

Maintain function button

If you click the Maintain function button, your event handler will be a Maintain function.

JavaScript button

If you click the JavaScript button, your event handler will be a JavaScript function.

VBScript button

If you click the VBScript button, your event handler will be a VBScript function.

Web link button

If you click the Web link button, your event handler will be a web link.

Deletes codes button

The Delete button deletes code for the existing event handler.

Maintain function button

If you click the Maintain function button, the code for closing your form (SELF.WINCLOSE();) is inserted.

Note: This code should be the last line of code in the event handler. Do not enter any code after this syntax. It will not be executed.

If you use this command to close the last form in your application, thus closing the application, you will receive an Invalid Response message from your browser. This behavior is expected. You should use the Self.WinExit (); syntax to exit your application.

Maintain function button

If you click the Maintain function button, the code for closing your application (self.WinExit();) is inserted.

Note: This code should be the last line of code in the event handler. Do not enter any code after this syntax. It will not be executed.

Event handler code area

If you selected the Maintain function, JavaScript, or VBScript button, this area is where you enter the code that defines your event handler.


WebFOCUS