Pulldown Menus and the Toolbar

The Oracle Applications pulldown menus (the default menu) allow the user to invoke standard Oracle Forms functions, such as "Clear Record" as well as application-specific functions.

Both the menu and the toolbar are included in the TEMPLATE form. Entries on the menu and the toolbar are disabled and enabled automatically based on the current context.

For details on each pulldown menu and iconic button on the Toolbar,, see the Oracle Applications User Interface Standards for Forms-Based Products.

Menu and Toolbar Entries

Your menu and toolbar should react consistently to changes within your forms. Unless specified otherwise, the following behaviors come automatically from the form-level triggers embedded in your forms. The triggers that control the behavior appear with each entry (if applicable).

Both Menu and Toolbar Entries

In order as they appear on the toolbar:

Menu-Only Entries

In order as shown on the pulldown menu, from File to Help:

Dynamic Menu Control

You can use the APP_SPECIAL.ENABLE procedure to dynamically control menu items, if the behavior you need is not provided automatically. First, determine if the default menu control handles the menu item in question, and ensure that there really is a need to override the default behaviors.

If the menu item is not controlled by the default menu control, use any appropriate trigger (typically PRE-BLOCK or WHEN-NEW-BLOCK-INSTANCE), adding the code:

 app_special.enable('the menu item', PROPERTY_OFF|ON); 

Turn the menu item back on when you leave (typically POST-BLOCK) by calling:

 app_special.enable('the menu item', PROPERTY_ON|OFF);

Include the full name of the menu item in this call, for example:

 app_special.enable('CLEAR.FIELD', PROPERTY_OFF); 

You can determine the full names of the menu items by copying FNDMENU from the AU_TOP/resource/<language> area and opening the copy to examine the menu items.

If the menu item is controlled by the default menu control and you want to modify its behavior (enable or disable it), create the field- or block-level trigger listed (either WHEN-NEW-BLOCK-INSTANCE, WHEN-NEW-RECORD- INSTANCE, or WHEN-NEW-ITEM- INSTANCE). Set the trigger Execution Hierarchy to "Override" and add the following code:

 app_standard.event('TRIGGER_NAME');
 app_special.enable('Menu_item', PROPERTY_OFF|ON);

The item will be correctly reset in other blocks by the default menu control, so it is not necessary to reset it when leaving the block, record, or item.

See: APP_SPECIAL: Menu and Toolbar Control

Common Coding Mistakes That Affect the Menu

The most common sources of problems with menu include the following coding mistakes:

Blocks Where Only One Record Is Possible

You may want to disable some menu options for blocks in which only one record is possible. The Single Record Blocks section discusses when and how to do this.

See: Single Record Blocks

Save and Proceed

By default, this function performs a Save, then moves to the First Navigation Data Block of the form and proceeds to the next record. You can override this behavior.

Replace the code within the form-level ACCEPT trigger, or create a block-level ACCEPT trigger with Execution Hierarchy set to Override that calls any of the following:

Synchronizing

The toolbar and menu are automatically updated by the standard form-level WHEN-NEW-RECORD-INSTANCE, WHEN-NEW- BLOCK-INSTANCE, and WHEN-NEW-ITEM-INSTANCE triggers. If you change a property of a block or an item, the menu and toolbar do not reflect this change until the appropriate trigger fires.

For example, if you turn the block property Insert Allowed off on a block while the cursor is already in that block, you must explicitly call the routine below to synchronize the menu and the toolbar:

APP_STANDARD.SYNCHRONIZE;

See: APP_STANDARD Package.

Application-Specific Entries: Special Menus

You can customize the menu to display application-specific values. The menu supports up to forty-five application-specific entries under three top-level special menu entries (usually called Tools, Reports, and Actions). The toolbar supports corresponding iconic buttons for any of the forty-five special menu entries.

Any icon placed on the toolbar must be approved by the User Interface Standards group, and will be maintained with all the other icons.

See: APP_SPECIAL: Menu and Toolbar Control

Example Special Menu Entry

Suppose you have a special function called 'Book Order' that you want to add to the menu and the toolbar. To add 'Book Order' as the first entry on the first special menu (Tools) and as an icon on the toolbar, such that they are only available in the 'Header' block of a form, do the following:

  1. Modify the form level PRE-FORM trigger:

    PRE-FORM
    
    
    app_special.instantiate('SPECIAL1', '&Book Order', 'bkord');
    
    

    If you plan to translate your form, you should use Message Dictionary, a parameter, or a static record group cell to store the Special Menu entry. You then retrieve the value (which is translated when the application is translated) into a variable and pass the variable to the APP_SPECIAL routine. For example:

    app_special.instantiate('SPECIAL1', my_menu_entry, 'bkord');
    
    
  2. Add a form-level PRE-BLOCK trigger:

    PRE-BLOCK
    app_special.enable('SPECIAL1',PROPERTY_OFF);
    
  3. Add a block level PRE-BLOCK trigger to the block in which you want to enable your special menu entries:

    PRE-BLOCK in HEADER block
    app_special.enable('SPECIAL1',PROPERTY_ON);
  4. Add a block level SPECIAL1 user-named trigger that contains code to actually perform your 'Book Order' function. It executes when the user chooses this menu entry.

Custom Toolbar Icons for Custom Forms

For custom forms, custom icon files must be separate standard .gif files located in the directory designated by the OA_MEDIA virtual directory (see your web server administrator for this information). Note that retrieving the icon file for a custom icon requires a round trip to the forms server, so you should limit the number of icons you retrieve if performance becomes an issue.

Any Oracle Applications icon placed on the toolbar must be approved by the Standards group, and will be maintained with all the other icons in the appropriate .jar file.

Disabling the Special Menu

To disable all special menu entries (for example, when entering query-mode), call APP_SPECIAL.ENABLE('SPECIAL', PROPERTY_OFF);

Customizing Right-Mouse Menus (Popup Menus)

Oracle Applications provides default right-mouse menu functionality for all text items. When a user presses the right mouse button (or equivalent "secondary" button) while holding the mouse pointer over the text item that currently has cursor focus, Oracle Applications displays a context-sensitive popup menu. The default menu entries are:

Cut
Copy
Paste
------
Folder
------
Help

You can customize the right-mouse menus to display application-specific entries in addition to the default entries. The right-mouse menu supports up to ten application-specific entries. Application-specific entries appear between the Folder and Help Entries (and separator lines). You can include separator lines among your entries. For example:

Cut
Copy
Paste
------------
Folder	
------------
First Entry
Second Entry
------------
Third Entry
------------
Help

APP_POPUP: Right-Mouse Menu Control

Adding Entries to Right-Mouse Menus

Adding entries to right-mouse menus requires at least two triggers in your form for each entry. The first trigger is the PRE-POPUP-MENU, which can be at block or item level depending on the desired behavior. The PRE-POPUP-MENU trigger calls the APP_POPUP.INSTANTIATE routine to set up the menu entry. This call includes the name, POPUP1 through POPUP10, of the menu entry function. Set the Execution Hierarchy of your trigger to After so your trigger fires after the form-level PRE-POPUP-MENU trigger (which must fire first to check that the user clicked over the field that currently has focus and to set the menu to its default state).

The second trigger is a corresponding user-named trigger called POPUP1 through POPUP10, typically at the block or item level, that contains the functionality you want to execute when a user selects your menu entry. Note that the popup menu entries appear, and if chosen will execute, even if the field is currently disabled, so if your logic should not execute when the field is disabled, you must test for that in your code.

Example Right-Mouse Menu Entry

Suppose you have a special function called "Approve" that you want to add to the right-mouse menu. To add Approve as the first custom entry on the right-mouse menu, such that it is only available in the Requisition Number field of a form, do the following:

  1. Modify the item-level PRE-POPUP-MENU trigger on the Requisition Number field. Be sure to set the trigger Execution Hierarchy to After.

    app_popup.instantiate('POPUP1', 'Approve');
    

    If you plan to translate your form, you should use Message Dictionary, a parameter, or a static record group cell to store the Special Menu entry. You then retrieve the value (which is translated when the application is translated) into a variable and pass the variable to the APP_SPECIAL routine. For example:

    app_special.instantiate('POPUP1', my_menu_entry);
    
  2. Add a field level POPUP1 user-named trigger that contains code to actually perform your "Approve" function. It executes when the user chooses this menu entry.