WHEN-IMAGE-PRESSED Trigger problem in Oracle Forms 6.0
Yesterday we ran into Oracle bug 1004056 while coding a module for a customer. I hear people think "Oracle Forms 60 thatâ€™s old". Yes it is but it is a platform still used by a lot of people. The bug is related to the fact that image items are not proper synchronized in a multi record block:
The form has an image with when-image-pressed trigger in order to get the record nr for each image
The form has 15 images and 15 records.
When you click on record 2 and then image 2, you will get different record numbers than the right one, e.g. record 5 instead of record 2 after you have scrolled through the record set.
In other words: the images do not get synchronized with the records.
Oracle sugests as work around: display one image at a time instead of displaying 15 images.
This was not an option for my customer.
However there is a workaround
Create a dummy image object in your block. Make sure that this dummy object is located before your image object in the block. In my case I created the image object attrib_image. Make sure that the image is located on tehsame canvas as the image you want to display, in my case the checkbox_image. Make sure that you add the code go_record(:system.mouse_record);go_item(:system.mouse_item); twice in the when-image-pressed trigger of your image item to make sure that the navigation is performed.Than add the code that needs to be executed when the image item is pressed.
After this execution you have worked around bug 1004056.
- The Hunt for the Oracle Database On Commit trigger
- Select Trigger in Oracle Database – introducing Fine Grained Auditing
- PL/SQL Source Code Control inside the database – After Compile trigger for automatic archiving
- PL/SQL post compiler to fix TAPI – dealing with the 'TAPI cannot deal with MERGE' problem
- Another VPD challenge with our Oracle Designer generated Web Forms application: No Data Found when synchronizing server derived values