Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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.
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

618 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