In Oracle Applications Release 12, alternative regions are replaced by tabbed regions. You should implement tabbed regions for all new code.
A block with multiple regions that cannot be rendered simultaneously uses a series of stacked canvases to display each region, one at a time, within a single region boundary. These stacked regions are called "Alternative Regions".
For more information, see the Oracle Applications User Interface Standards for Forms-Based Products.
Each alternative region has a poplist control element containing all possible regions for that block.
Alternative region poplists should behave according to the following standards:
The Alternative Region poplist should have the Query Allowed attribute set to Yes, so that it can be used while the block is in ENTER-QUERY mode.
KEY-MENU invokes an LOV that allows the user to select from the same list of choices as in the control poplist. The title of this LOV is "Regions." You need this function for keyboard compatibility because the control poplist is not otherwise accessible except via the mouse.
Block LINES has some fields on a content canvas ORDER. The last of these fields is ITEM.
LINES has alternative regions on canvases LINES_PRICE and LINES_ITEM. The regions are accessible only if LINES.ITEM is not null. The first item of LINES_PRICE is LIST_PRICE. The first item of LINES_ITEM is DESCRIPTION.
Create a poplist in a control block to select the current region. The poplist should be queryable and non-navigable. The poplist should display a friendly name for each region with a corresponding value equal to the region's canvas name.
The block CONTROL has a queryable, non-navigable poplist named LINES_REGIONS (block name plus _REGIONS) that contains the following values, with the internal value following the displayed value: Price Information (LINES_PRICE), Item Information (LINES_ITEM).
Visit the CONTROL block:
At form startup, you must visit the block containing the control poplist to instantiate it:
Create a text item called DUMMY as the first item in the CONTROL block. Make the text item Visible, Enabled and Keyboard Navigable, Position 0,0, WD=0, HT=0, and +-Length=1. Place it on the first canvas to be displayed.
In WHEN-NEW-FORM-INSTANCE, make two GO_BLOCK() calls, one to the CONTROL block and another to the First Navigation Block.
Make sure you do similar GO_BLOCK calls in the code where you handle KEY-CLRFRM.
Setting the First Displayed Region:
Within Oracle Forms Designer, designate the first stacked canvas of the set of alternative regions to show as displayed; make all other canvases in the set not displayed to improve startup performance.
You must sequence the stacked canvases carefully by ordering the canvases within the list in the Oracle Forms Object Navigator (the first stacked canvas in the list is the first stacked canvas displayed). In addition, you must sequence your items to have the correct order when a user tabs through the fields on the alternative regions.
Suggestion: When stacked canvases are referenced, their sequence may be unpredictable. In this case, issue a SHOW_VIEW at form startup, or whenever the window is first displayed, to force the proper canvas to render.
Make sure your stacked canvas views are all exactly the same size and occupy exactly the same space on the content canvas.
Create your item handler procedures to control which region displays as in the following example. Remember, in our example form, we want to disallow access to the regions unless the field LINES.ITEM is not null:
PACKAGE BODY control IS
g_canvas_name VARCHAR2(30) := null;
PROCEDURE lines_regions(event varchar2) IS
target_canvas_name VARCHAR2(30);
curr_canvas_name VARCHAR2(30) :=
get_item_property(:system.cursor_item,
ITEM_CANVAS);
BEGIN
IF (event = 'WHEN-NEW-ITEM-INSTANCE') THEN
-- Check if the poplist and the canvas are out of synch
-- to prevent flashing if they are not.
IF ((curr_canvas_name in ('LINES_PRICE', 'LINES_ITEM')) AND
(curr_canvas_name != :control.lines_regions)) THEN
:control.lines_regions := curr_canvas_name;
g_canvas_name := curr_canvas_name;
END IF;
ELSIF (event = 'WHEN-LIST-CHANGED') THEN
target_canvas_name := :control.lines_regions;
-- The following is optional code to disallow access
-- to certain regions under certain conditions
-- Check that the region is accessible. Always allow access
-- during queries.
IF (:SYSTEM.MODE = 'ENTER-QUERY') THEN
null;
ELSE
IF (:lines.item is null) THEN
FND_MESSAGE.SET_NAME('OE', 'OE_ENTER_ITEM_FIRST');
FND_MESSAGE.ERROR;
:control.lines_regions := g_canvas_name;
RAISE FORM_TRIGGER_FAILURE;
END IF;
-- End of optional code
END IF;
-- Display the region. If in the same block, go to the
-- first item in the region.
IF curr_canvas_name in ('LINES_PRICE', 'LINES_ITEM') THEN
hide_view(curr_canvas_name);
END IF;
show_view(target_canvas_name);
IF (:system.cursor_block = 'LINES') THEN
IF (target_canvas_name = 'LINES_PRICE') THEN
-- Go to the first item in the canvas LINES_PRICE
go_item('lines.list_price');
ELSIF (target_canvas_name = 'LINES_ITEM') THEN
-- Go to the first item in the canvas LINES_ITEM
go_item('lines.description');
END IF;
END IF;
g_canvas_name := target_canvas_name;
ELSE
fnd_message.debug('Invalid event passed to
control.lines_regions');
END IF;
END lines_regions;
END control;
After the user displays the LOV via KEY-MENU and chooses a value from the list, the WHEN-LIST-CHANGED handler switches the regions.
Call the following triggers:
Trigger: Block-level WHEN-NEW-ITEM-INSTANCE on the LINES block:
CONTROL.LINES_REGIONS('WHEN-NEW-ITEM-INSTANCE');
Trigger: Block-level KEY-MENU on the LINES block (Execution Hierarchy: Override):
IF APP_REGION.ALT_REGIONS('CONTROL.LINES_REGIONS') THEN
CONTROL.LINES_REGIONS('WHEN-LIST-CHANGED');
END IF;
Trigger: Item-level WHEN-LIST-CHANGED on CONTROL.LINES_REGIONS.
CONTROL.LINES_REGIONS('WHEN-LIST-CHANGED');
These triggers should fire in ENTER-QUERY mode.