views:

112

answers:

1

This might be simple but I am new to Oracle. I am using Oracle 10g and have a form that lists our information from a linked table in a tabular Layout. The last column of data is a "list Item" item type that has the Element list of Enabled (T) and Disabled (F).

What I need is when a user changes this dropdown, to disabled, I want ONLY that row to have some of the columns be disabled and not the entire column.

This is also assuming on load of the form, it will disable and enable rows of data depending on what values are being pulled from the EnabledDisabled column in the database.

Thanks for the help!

A: 

Option 1: use the ENABLED item property.

Unfortunately Oracle Forms does not allow changing the ENABLED property of an item at the item instance level.

What you can do, however, is enable or disable the whole item when the user enters a record - use the WHEN-NEW-RECORD-INSTANCE trigger - depending on the value of the current record's value for the list item, the trigger would set the ENABLED property to PROPERTY_TRUE or PROPERTY_FALSE.

Of course, your list item would also have the same code in its WHEN-LIST-CHANGED trigger.

The downside to this approach is that the whole column will "look" disabled to the user, and they will not be able to select a different record using those disabled items.

Option 2: use the INSERT_ALLOWED and UPDATE_ALLOWED properties.

You can set these properties at the item instance level using SET_ITEM_INSTANCE_PROPERTY. You would set them in the block's POST-QUERY trigger, as well as in the list item's WHEN-LIST-CHANGED trigger.

This would not, however, change how the items look on the screen. To solve this, you could also set a visual attribute at the item instance level (e.g. change the items to use a dark gray background or something).

More comments.

Jeffrey Kemp
Well, that stinks. Okay, well I guess I will just make the description of the functionality clear on the form for the users. Thanks again Jeff for the time you saved me on not spinning my wheels.
DotNetDan
Not straightforward, unfortunately :) - but I've used option 2 to good effect a number of times.
Jeffrey Kemp