Home » Developer & Programmer » Forms » When tab page changed (Oracle Forms 6i)
When tab page changed [message #400824] Wed, 29 April 2009 14:44 Go to next message
LUCKYJACK
Messages: 2
Registered: April 2009
Location: USA
Junior Member
I have issues with when_tab_page_changed I don't want user to select on to my second tab page when my first tab page is in insert mode. I want to lock the second tab page chaned.

PROCEDURE WHEN_TAB_PAGE_CHANGED IS
tp_nm VARCHAR2(30);
tp_id TAB_PAGE;
tp_lb VARCHAR2(30);
BEGIN
tp_nm := GET_CANVAS_PROPERTY('XXFPS_REGULATORY_TAB', topmost_tab_page);
tp_id := FIND_TAB_PAGE(tp_nm);
tp_lb := GET_TAB_PAGE_PROPERTY(tp_id, label);

IF (name_in('system.mode') = 'ENTER-QUERY') THEN
DO_KEY('ABORT_QUERY');
ELSIF :System.BLOCK_STATUS IN ('CHANGED','INSERT','NEW') THEN
clear_block(ASK_COMMIT);
ELSIF :System.RECORD_STATUS IN ('CHANGED','INSERT','NEW') THEN
clear_record;
END IF;

IF tp_lb = 'Regulatory Product' THEN
Show_view('XXFPS_REGULATORY_S1');
Show_view('XXFPS_REGULATORY_S2');
GO_BLOCK('XXFPS_REGULATORY_PRODUCTS_T');
GO_ITEM('XXFPS_REGULATORY_PRODUCTS_T.REGULATORY_PRODUCT');
HIDE_VIEW('XXFPS_REGULATORY_HIST_S1');
HIDE_VIEW('XXFPS_REGULATORY_HIST_S2');
-- execute_query;
ELSE
Show_view('XXFPS_REGULATORY_HIST_S1');
Show_view('XXFPS_REGULATORY_HIST_S2');
GO_BLOCK('XXFPS_REGULATORY_PRODUCTS_HIST');
GO_ITEM('XXFPS_REGULATORY_PRODUCTS_HIST.REGULATORY_PRODUCT');
HIDE_VIEW('XXFPS_REGULATORY_S1');
HIDE_VIEW('XXFPS_REGULATORY_S2');
-- execute_query;
END IF;
END WHEN_TAB_PAGE_CHANGED;
Re: When tab page changed [message #401889 is a reply to message #400824] Wed, 06 May 2009 19:03 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
If you don't want a piece of logic to continue then throw a 'raise form_trigger_failure'.

David
Re: When tab page changed [message #403200 is a reply to message #400824] Thu, 14 May 2009 03:04 Go to previous messageGo to next message
expertsudhir
Messages: 26
Registered: October 2008
Location: Delhi, India
Junior Member

It is suggested you to take global variable and programatically manage the mode. it will help instead of using system.mode

for example:
in new_form_instance
start a variable
:Global.Mode := 'NORMAL';

when new record in inserted in the block make it 'INSERT' or edit then 'EDIT' so it will be easy to tackle this type of problem.

if u have any problem still pl attach the dummy form.
Re: When tab page changed [message #403292 is a reply to message #403200] Thu, 14 May 2009 11:28 Go to previous message
LUCKYJACK
Messages: 2
Registered: April 2009
Location: USA
Junior Member
Hi folks,


Thanks for your help but I found other alternative solutions it was simple here is the code!


IF :system.record_status IN ('NEW') THEN
CLEAR_RECORD;
Show_view('XXFPS_REGULATORY_HIST_S1');
Show_view('XXFPS_REGULATORY_HIST_S2');
GO_BLOCK('XXFPS_REGULATORY_PRODUCTS_HIST');
GO_ITEM('XXFPS_REGULATORY_PRODUCTS_HIST.REGULATORY_PRODUCT');
HIDE_VIEW('XXFPS_REGULATORY_S1');
HIDE_VIEW('XXFPS_REGULATORY_S2');
ELSIF :system.record_status in ('INSERT') THEN
set_canvas_property('XXFPS_REGULATORY_TAB',
topmost_tab_page,name_in('system.tab_previous_page'));
Show_view('XXFPS_REGULATORY_S1');
Show_view('XXFPS_REGULATORY_S2');
GO_ITEM(:system.trigger_item);
GO_RECORD(:system.cursor_record);
ELSE
Show_view('XXFPS_REGULATORY_HIST_S1');
Show_view('XXFPS_REGULATORY_HIST_S2');
GO_BLOCK('XXFPS_REGULATORY_PRODUCTS_HIST');
GO_ITEM('XXFPS_REGULATORY_PRODUCTS_HIST.REGULATORY_PRODUCT');
HIDE_VIEW('XXFPS_REGULATORY_S1');
HIDE_VIEW('XXFPS_REGULATORY_S2');
END IF;
Previous Topic: Starting MS Outlook with subject and body passed from DB
Next Topic: lov color
Goto Forum:
  


Current Time: Fri Dec 09 03:45:51 CST 2016

Total time taken to generate the page: 0.11523 seconds