Home » Developer & Programmer » Forms » Problem with GET_ITEM_PROPERTY(:SYSTEM.CURSOR_ITEM, ITEM_IS_VALID) (Oracle Forms Builder, 10.1.2.0.2, Windows XP)
Problem with GET_ITEM_PROPERTY(:SYSTEM.CURSOR_ITEM, ITEM_IS_VALID) [message #360465] Fri, 21 November 2008 02:14 Go to next message
irvs79
Messages: 7
Registered: April 2008
Junior Member
Hello to all,

I am currently having a problem with GET_ITEM_PROPERTY(:SYSTEM.CURSOR_ITEM, ITEM_IS_VALID) function. This function is being called to validate the current item where the cursor is located just before closing the form. When the user chooses Exit option from a menu item, it is invoking a procedure that uses the said function. The problem here is that the function is returning 'FALSE', which means the item's value is invalid where in fact the value is actually valid. As a result, the user is not able to exit the form.

I have checked the triggers on item level and I did not find anything that would cause the said problem. I made a layout on how the process is being done:

A user chooses Exit option from the menu and KEY-EXIT trigger is being fired.

FORM LEVEL TRIGGER: KEY-EXIT
BEGIN
PACKAGE_A.VALIDATE_ITEM;
COMMIT_FORM;
EXIT_FORM;
END;

PACKAGE_A.VALIDATE_ITEM
BEGIN
IF GET_ITEM_PROPERTY(:SYSTEM.CURSOR_ITEM, ITEM_IS_VALID)
= 'FALSE' THEN
BELL;
MESSAGE('Input item is invalid. Exit form failed.');
RAISE FORM_TRIGGER_FAILURE;
END IF;
END;

Since GET_ITEM_PROPERTY function is returning 'FALSE', the package procedure is raising a form trigger failure and will not continue to exit the form. Given the said situation, I tried playing around with the screen during run time. On first attempt, I put the cursor focus to ITEM1. As expected, I was not able to exit the form. After the message occured, I transferred the cursor to the next item. Afterwhich, I shifted the cursor back to ITEM1 and selected the same Exit option from the menu. To my surprise, the form actually closed and I was able to exit the module. I did the same steps again to verify the pattern. I do not understand why this is happening when in fact, they are all going through the same procedures and functions. Both items have the same data types and values. Actually, they both have Null values.

Do you have any idea why this is happening? Your help will be very much appreciated.



Thank you very much,

Irvin

Re: Problem with GET_ITEM_PROPERTY(:SYSTEM.CURSOR_ITEM, ITEM_IS_VALID) [message #360764 is a reply to message #360465] Mon, 24 November 2008 00:12 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please review the help documentation for 'system.cursor_item'. Perhaps you should use 'system.trigger_item' or verify that 'system.cursor_item' is not null before testing as to whether it is valid.

David
Previous Topic: scrolling data
Next Topic: Set working directory programatically
Goto Forum:
  


Current Time: Sat Oct 25 21:03:28 CDT 2014

Total time taken to generate the page: 0.10617 seconds