Oracle Forms recognizes a predefined set of runtime events, each of which has a corresponding built in trigger. When you add code to an application by writing a trigger, it is important to decide what event should fire the trigger. The event you choose determines the name assigned to the trigger.
When selecting triggers, it is important to understand precisely when events occur, both in relation to other events, and in relation to form processing. Some events are external interface events, and their occurrence is immediately apparent. Examples of such events, and their corresponding triggers, include the following:
Event |
Trigger Name |
---|---|
Pressing a button |
|
Clicking a check box |
|
Pressing the Tab key |
Internal events occur as a result of runtime processing. These events occur according to the Oracle Forms processing model.
Consider a form with two blocks, Block A and Block B, with text items in each block. On GUI platforms, operators can move the input focus from a text item in Block A to a text item in Block B by clicking the target item with a mouse. Although this operation involves only one interface action (the mouse-click in the target item), it actually sets off a series of internal processing events, each of which has one or more corresponding triggers:
Event |
Trigger Name |
---|---|
Validate the item |
|
Leave the item |
|
Validate the record |
|
Leave the record |
|
Leave the block |
|
Enter the block |
|
Enter the record |
|
Enter the Item |
|
Ready block for input |
|
Ready record for input |
|
Ready item for input |
It is important to understand that navigational events such as "Leave the Item" and "Enter the Block" occur as a result of internal form processing navigation. These events occur as Oracle Forms validates data in the form and "navigates" through the object hierarchy to move from one item to another.
In the example, to move the input focus from a source item in one block to a target item in another, Oracle Forms first validates the value in the source item, then "enters the record" to validate all of the items in the record, then leaves the record and "enters the block," and so on, finally ending up in the target item.
The Oracle Forms processing model enforces the integrity of data at the item, record, block, and form level. The rich assortment of events to which can be responded with trigger code gives complete control over every aspect of an application.
A process is a series of individual, related events that occurs during a specific Oracle Forms Runform operation. The previous example described a navigational process. Other processes involve validation and database transactions. For example, the Post and Commit Transaction process includes a complex series of events and sub-processes.
Trigger Definition Level and Scope
Creating a trigger in the Object Navigator