Wednesday, February 24, 2010

WHEN-TAB-PAGE-CHANGED usage

This is applicable to forms 6i.

In a custom form with tabs, when user is in a tab and presses F2 key, list of tabs are displayed and by selecting another tab, another tab is displayed but cursor remian in prior tab. Cursor can be moved to the selected tab by modifying "WHEN-TAB-PAGE-CHANGED" trigger at form level. The simple modifications to the trigger are


DECLARE
tab_name VARCHAR2(90);
BEGIN
tab_name := get_canvas_property('MY_CANVAS',topmost_tab_page);
IF tab_name = 'TAB_A' THEN
go_item('BLOCK_A.FIELD_A');
ELSIF tab_name = 'TAB_B' THEN
go_item('BLOCK_B.FIELD_A');
ELSIF tab_name = 'TAB_C' THEN
go_item('BLOCK_C.FIELD_A');
ELSIF tab_name = 'TAB_D' THEN
go_item('BLOCK_D.FIELD_A');
ELSIF tab_name = 'TAB_E' THEN
go_item('BLOCK_E.FIELD_A');
ELSE
fnd_message.debug('Tab name ' || tab_name || ' not in if conditions');
END IF;
END;

5 comments: