'Oracle Forms doesn't completely respect my setting for the background color of an item

I'm forced to use Oracle Form Builder 10.1.2.3.0. An ideal control I can use in the form for a particular item is a List Item using a List Style called Combo Box.

Using this control, I can use set_item_property in a PRE-FORM trigger to set the background color of the list items to match the Canvas color.

The default background color of the items is white but that's not the biggest part of the problem. What is a pretty big UI problem is the color of the items after a selection is made: a horrible mustard color. I prefer something more Spartan and certainly something other than screaming "Hey! Look at me!".

When I run the form, everything is good until I choose an item in the list. Afterwards, the background of the selected item is mustard. And each popup of the list shows the items with a mustard background.

I figured I could add triggers to the Item to reset the background color but that didn't work. I created the following triggers to no avail:

. WHEN-LIST-CHANGED
. POST-CHANGE
. WHEN-VALIDATE-ITEM
. WHEN-NEW-ITEM-INSTANCE

I couldn't find any other trigger names that might be useful.

Is there hope for the code to force my UI preferences?


Before any action upon the control:

Before any action upon the control


During the first popup:

First popup


After selecting an item during the first popup:

After selection


Second popup:

Second popup



Solution 1:[1]

If the Data Block containing the item is not a database item, then you can alter that block so that it is not updateable. If you do that, then the mustard color won't be used.

It seems the purpose of the change in color (to mustard) is a visual clue that changes to the database have not been committed. But if the Data Block is not a database block, then there's no need for the visual clue because no changes would be possible.

I changed DML Data Target Type from Table to None and the mustard color no longer appears.

The other settings which I didn't change but which might also be relevant are:

Database Data Block = No
Query Data Source Type = None
Insert Allowed = No
Update Allowed = No
Locking Mode = Delayed
Delete Allowed = No
Update Changed Columns Only = No

Even if it is a database item, you can set the item's update_allowed property to false in its WHEN-LIST-CHANGED trigger and set it to property_true in its WHEN-MOUSE-CLICK trigger. This is not perfect because if you click on a list item's text instead of the down arrow, then you still get the mustard but at least after you're done, the mustard is gone.

Solution 2:[2]

If you are using Oracle E-Business Suite they likely have that functionality coded in the template form, which I would guess and say you are likely using.

If you are not using EBS, then you likely have code in your form making this change. For example, if you have a WHEN-LIST-CHANGED trigger that includes a line of code that looks something like this you will get the behavior you are describing:

SET_ITEM_PROPERTY ('LIST1', BACKGROUND_COLOR, 'OLAF1');

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 MichaelJF