Home » Developer & Programmer » Forms » How to achieve data saving while tab change. (oracle forms)
How to achieve data saving while tab change. [message #329194] Tue, 24 June 2008 08:16 Go to next message
mailmearun06
Messages: 7
Registered: June 2008
Junior Member
Hi Experts,

I have got 5 tabs and Tabular canvas in each tabs.

If there is any DATA in the TEXT ITEM of TAB1 and while navigating from TAB1 to TAB2 i would like to get an Oracle standard alert to the USER whether to save the record of not( with 'yes', 'no' and 'cancel').

How this can be achieved. I have used WHEN-TAB-PAGE-CHANGED TRIGGER.

Please help me on this.

Cheers,
Arun
Re: How to achieve data saving while tab change. [message #329235 is a reply to message #329194] Tue, 24 June 2008 11:20 Go to previous messageGo to next message
mailmearun06
Messages: 7
Registered: June 2008
Junior Member
Guys pls help me on this Sad
Re: How to achieve data saving while tab change. [message #329335 is a reply to message #329194] Wed, 25 June 2008 02:42 Go to previous message
averno9
Messages: 30
Registered: June 2008
Location: Spain
Member
Ok, first of all you need to make sure this event is happening. I'm sure it will, but it's not the same saying 'probably' than saying 'of course'.

To do this, in the menu go to Tools -> Preferences -> Runtime tab -> check Debug messages.

With this, you will see a message with every event is happening.

Test your application and test the WHEN-TAB-PAGE-CHANGED is happening. When you are sure it is, you can put this in your code: (this is an example, you should change names and add something)

<WHEN-TAB-PAGE-CHANGED event>
DECLARE
nChoice NUMBER(1); -- This stores the choice of the user.
BEGIN
IF :BLOCK1.TEXTITEM1 IS NOT NULL THEN
nChoice := ShowAlertYesNoCancel('Do you want to save changes?'); -- You shoul have created an alert with this name

IF nChoice = 1 THEN -- User pushed Yes,
COMMIT; -- Save the information.
ELSE -- User didn't push Yes.
RAISE Form_Trigger_Failure; -- Don't do anything
-- You can use a ROLLBACK, i'm not sure what you expect from your program
END IF;
END;

I hope this helps, good luck.
Previous Topic: How to connect 10g db with 10g forms & report?
Next Topic: Master/detail tables, problem interconnecting with an id
Goto Forum:
  


Current Time: Fri Dec 09 02:21:30 CST 2016

Total time taken to generate the page: 0.17260 seconds