How to achieve data saving while tab change. [message #329194] |
Tue, 24 June 2008 08:16 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 #329335 is a reply to message #329194] |
Wed, 25 June 2008 02:42 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
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.
|
|
|