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

Posted on 2002-06-11
Medium Priority
Last Modified: 2012-06-21

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..

   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
   ITEMS    --- APPLY
   ITEMS    --- REVERT
Question by:asuresh73
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 35

Accepted Solution

Mark Geerlings earned 400 total points
ID: 7069901
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.

Expert Comment

ID: 7069921
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);

Author Comment

ID: 7082900

I was able to solve this problum. Thankz of co-operation.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 35

Expert Comment

by:Mark Geerlings
ID: 7083791
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.

Expert Comment

ID: 7520455
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


Expert Comment

ID: 9170693
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.
EE Cleanup Volunteer

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

764 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