|
HOW TO CREATE FIELD THAT ACCEPTS NEGATIVE AND POSITIVE VALUES -- FRM-40403
Problem Description: ====================
How do you create a text item that accepts negative ( - ) and positive ( + ) values?
You create a multi-form application. The calling form contains a multi-record block
and a field which can hold a signed ( +/- ) value. When you enter a positive value,
this calls another form where you can enter comments. Suppose you enter a negative
number and use the mouse to change the value to a positive number,
the following error occurs:
FRM-40403: A calling form has unapplied changes. Save not allowed.
Oracle Forms does not recognize the change until you press the Enter key.
When you call the form from a navigational trigger, the following error occurs:
FRM-40403: A calling form has unapplied changes. Save not allowed.
When you navigate with the mouse, the mouse event triggers do not fire.
Problem Explanation: ====================
The Mouse Event Triggers include: When-Mouse-Click, When-Mouse-DoubleClick,
When-Mouse-Down, When-Mouse-Enter, When-Mouse-Leave, When-Mouse-Move, and When-Mouse-Up.
The Navigational Triggers include: Post-Block, Post-Form, Post-Record, Post-Text-Item,
Pre-Block, Pre-Form, Pre-Record, Pre-Text-Item, When-Form-Navigate, When-New-Block-Instance,
When-New-Form-Instance, When-New-Item-Instance, When-New-Record-Instance, and User-Named.
See TRIGGER TABLES: Interface Event Triggers and Navigational Triggers in chapter 2, "Triggers",
of the Oracle Forms 4.5 Reference Manual, Volume 1.
Solution Description: =====================
This is not possible. Workaround ----------
1. Create and attach the following When-Mouse-Leave trigger code to the
item that contains the sign:
:global.sign := 'sign';
2. Notify the user to press the Enter key.
Create and attach the following
When-Mouse-Click trigger code to the item's block:
IF :global.sign = 'sign' THEN
GO_ITEM('sign');
MESSAGE('Press Enter to leave the field.');
END IF;
:global.sign := ' ';
|