Solved

Forms6i: Post-Text-Item and Pre-Text-Item

Posted on 2002-06-11
6
9,837 Views
Last Modified: 2012-06-21
Hai,

I'm using forms 6i on Oracle9i database.
I have 2 blocks, block 1 -> CTL_1_BLK has 3 text items(txt1,txt2 and txt3). and 2nd block -> CTL_2_BLK has 2 buttons (APPLY and REVERT).

In BLOCK CTL_1_BLK i have two triggers POST-TEXT-ITEM and PRE-TEXT-ITEM written in BLOCK LEVEL.

In Pre-Text-Item i'm storing old value (before user enters new value) into a variable :parameter.pre_value and in Post-Text-Item i'm storing new value entered by user in :parameter.post_value. In POST-TEXT-ITEM i'm comparing old and new values(stored in 2 parameters) if the values are changed i will update the changed value ( here i will provide a confirmation window to user-- YES or NO ) If user clicks on YES from the confirmation window will update the database else if user clicks on NO i will revert back to old value which was stored in parameter during PRE-TEXT-ITEM trigger.

My question is, If I change the "txt_1" value and i click on apply i will be getting confirmation window( because post-text-item trigger will fire). If i click on Revert button (in 2nd block) again it will display the confirmation window.
Here some how i have to avoid to display this confiration window when user clicks on REVERT BUTTON, ie. some how i have to hide this confiramation window as soon as user clicks on REVERT BUTTON.

Can anyone give me the inputs..

BLOCK-1
   TRIGGERS --- POST-TEXT-ITEM ( stores new value and calls alert depending on check between :parameter.pre_value and :parameter.post_value)
            --- PRE-TEXT-ITEM (stores pre value)
   ITEMS    --- TXT-1
            --- TXT-2
            --- TXT-3
BLOCK-2
   ITEMS    --- APPLY
      TRIGGER --- WHEN BUTTON PRESSED
   ITEMS    --- REVERT
      TRIGGER --- WHEN BUTTON PRESSED
 
0
Comment
Question by:asuresh73
6 Comments
 
LVL 34

Accepted Solution

by:
Mark Geerlings earned 100 total points
Comment Utility
I usually avoid pre-text_item and post-text-item triggers because they are fired more frequently than you expect, and at some times that you might not expect.

Is the block with the data items based on a table or view?
If it is, I would suggest creating some non-displayed items in the block, one for each displayed item to hold the "pre" value.  You can populate them all with a post-query trigger.  You don't need post-text-item triggers or a place to hold the "after" values since they are available directly in the items the user has access to.

You can then use a when-validate-item trigger to pop up a confirmation alert if the value has been changed.  Another option would be to use a when-validate-record trigger so that there would be only one confirmation alert regardless of how many items were changed.

If the block is not a base-table block, then the coding becomes more complex.  Oracle Forms may not be the best or easiest tool to use for non-base table forms.
0
 
LVL 5

Expert Comment

by:ser6398
Comment Utility
If I understand your question, I think you want to set the Mouse Navigate property for the Revert button to NO.  Then, in a When-Button-Pressed trigger on the Revert button, set the value of the current item (use SYSTEM.CURSOR_ITEM to get current item) to :parameter.pre_value

Example:  COPY( :parameter.pre_value, :System.Cursor_Item);
0
 

Author Comment

by:asuresh73
Comment Utility
Hello,

I was able to solve this problum. Thankz of co-operation.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 34

Expert Comment

by:Mark Geerlings
Comment Utility
If one of the responses helped you solve the problem, then please accept that as the answer to close the question.  Also, please leave a comment to describe how you solved it, since that may help others.
0
 

Expert Comment

by:lionofthejungle
Comment Utility
Hi ASuresh,

What i inferred from your problem is that you want to apply the changes if the button is pressed and also the two values are different.
What i propose is that you call the alert on when button pressed trigger of the apply button rather than calling it on the poat text item
this way  when you press the apply button then only it will ask for a confirmation

I guess it will help

If i am not able to infer correctly from your problem then sorry about it

Please do write i will try my bst to help

thanks
0
 
LVL 5

Expert Comment

by:jpkemp
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Split between markgeer & ser6398
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
jpkemp
EE Cleanup Volunteer
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now