Using a Maintain Function as an Event Handler

How to:

The most common event handler is a Maintain function.

We recommend that, whenever possible, you create a Maintain function using the Project Explorer, and then invoke this Maintain function from the Event Handler editor. Doing so has the following advantages:

Note: You cannot place CALL or EXEC statements in the Event Handler editor. You must place them in a Maintain function, and then perform the function from the Event Handler editor.


Top of page

x
Procedure: How to Execute a Maintain Function From the Event Handler Editor
  1. Open the Event Handler editor.
  2. Select a control and an event from the drop-down lists.
  3. Click the Maintain function button Maintain function button .
  4. Type the following code in the box:
    PERFORM function( );

    where:

    function

    Is the name of the function (or case) you want to call.

Tip: Instead of typing the above statement, you can drag the function from the Project Explorer into the Event Handler editor.

When an end user causes the event to happen to the control (for example, a button being clicked), the application executes the function.


WebFOCUS