Saturday, June 30, 2012

FormFunctions



Previous | Page 1 of 1 | Next

Programming Function Keys

Map with compass pointing to ObjectivesPurpose

Form Builder enables you to redefine the actions of function keys. This module shows you how to create key triggers to either intercept, or supplement, the usual function key behavior with which your users navigate an Oracle Forms Developer application.

Objectives

After completing this module, you should be able to:

* Define key triggers and their uses
* Program function keys
* Describe the characteristics of key triggers
* Classify key triggers
* Associate function keys with interface controls


                               

Understanding Key Triggers

When you press a function key, Forms usually performs the default function associated with that key. You can modify the standard functionality of a function key by defining a key trigger for that function key.

What is a Key Trigger?

A key trigger, like any other trigger, is a subprogram that is executed when a certain event occurs. In the case of a key trigger, the event is pressing the function key for which the trigger is defined. The trigger is usually named after the event that causes it to fire. When the key trigger is defined for a function key, the usual functionality of the key is replaced by the PL/SQL text of the trigger. In this respect, key triggers resemble "on" triggers.






Code Examples

1) This form-level Key-Exit trigger displays an alert asking the end user if he/she wants to leave the form.
SET_ALERT_PROPERTY ('question_alert', ALERT_MESSAGE_TEXT, 'Do you really want to leave the form?');
IF SHOW_ALERT ('question_alert') = ALERT_BUTTON1 THEN

EXIT_FORM; -- default functionality
END IF;
Note: If you also want to execute the default functionality of the function key, you must ensure that the key trigger includes the built-in function associated with the key.
2)The following Key-Crerec trigger disables the Create Record key:
BEGIN
NULL;
END;

Defining Key Triggers

You define key triggers in the same way that you define any other trigger. However the following two properties in the Property Palette for triggers only apply to key triggers.
Property Description
Display in Keyboard Help Specifies whether a key trigger description is displayed in the run time Keys Help window.
Keyboard Help Text Specifies the text that is displayed in the run time Keys Help window if the display in the Keyboard Help property is set to Yes. (If you want the default description to be displayed, leave this property blank).
Previous | Page 1 of 1 | 


  • Characteristics of Key Triggers

    Rules of Key Triggers

    * You cannot redefine all function keys with key triggers. Some keys are handled by the terminal or window interface manager rather than by Forms. Examples of such static function keys are [Clear Item], [Left], [Right], and [Toggle Insert/Replace].
    * You can define key triggers at all three levels: form, block, and item.
    * You can use SELECT statements, restricted built-in functions, and unrestricted built-ins.
    * Key triggers can fire in Enter Query mode.
    Note: You cannot use all built-ins in Enter Query mode.
    If you do not redefine a function key, a built-in function performs its default functionality when you press the key. Therefore, in most cases, a built-in function and a key trigger are associated with a function key. The following are a few examples of this association.
    More information, including a complete list of key triggers, can be found in Function Key Triggers in the Forms Builder documentation.


    Classifying Key Triggers

    You can distinguish among different types of key triggers. Learning these classifications will help you understand when to use key triggers.

    Types of Key Triggers

    * Function key triggers
    * Key-Fn triggers
    * Key-Others triggers

     

    Key Mapping

    Key mapping is defined by a Java resource file that you can edit with any text editor. The default resource file is FMRWEB.RES. Another resource file, FMRPCWEB.RES, has Java key mappings that resemble those on Windows. The term run-time parameter enables you to specify the use of a Java resource file other than the default.












No comments:

Post a Comment