Examples of SET_ITEM_PROPERTY in Oracle Forms

Examples of SET_ITEM_PROPERTY in Oracle Forms

In Oracle Forms, SET_ITEM_PROPERTY built-in is used to set an Item property at runtime. For example, you want to make enable or disable a push button on a certain condition. Then you can use SET_ITEM_PROPERTY built-in to do that. Below I am giving some examples of SET_ITEM_PROPERTY in Oracle Forms.


SET_ITEM_PROPERTY('block.item_name', property_setting, property_value);

Key Applications:

  1. Enabling or disabling items: By using set_item_property, developers can easily enable or disable form items based on certain conditions. For example, if a user selection requires specific input, set_item_property can disable or enable the relevant items accordingly.
  2. Modifying item appearance: set_item_property allows developers to change the visual attributes of items dynamically. Properties like foreground and background colors, font styles, item height, and width can be modified, providing a way to enhance the user interface and create a more visually appealing form.
  3. Controlling navigation and validation: With set_item_property, developers can control the navigation behavior of form items. For instance, it is possible to specify whether an item should be included in the natural tab order or if it should skip certain items during tabbing. Additionally, the validation behavior of an item, such as mandatory field checks, can be adjusted using this function.
  4. Manipulating item values: Using set_item_property, developers can manipulate item values programmatically. This enables tasks such as dynamically populating item values based on user input, performing calculations, or clearing item values when certain conditions are met.

SET_ITEM_PROPERTY Built-in Examples

1. The following example disables a Text Item named ENAME in EMP block.

SET_ITEM_PROPERTY('emp.ename', enabled, property_false);

2. To disable a push button in Oracle Forms. Below example will disable the push button named SAVEBUTTON in CONTROL block.

SET_ITEM_PROPERTY('control.savebutton', enabled, property_false);

3. To enable push button use the following statement.

SET_ITEM_PROPERTY('control.savebutton', enabled, property_true);

4. Change the label of a push button.

SET_ITEM_PROPERTY('control.savebutton', label, 'New Label');

5. Change the prompt text of an item in Oracle Forms.

SET_ITEM_PROPERTY('emp.ename', prompt_text, 'Employee Name: ');

6. Change the width of an item. Applies to push button and text items.

SET_ITEM_PROPERTY('emp.ename', width, 200);

7. To do not allow to update a field.

SET_ITEM_PROPERTY('emp.ename', update_allowed, property_false);

8. Set the visual attribute for an item.

SET_ITEM_PROPERTY('emp.ename', visual_attribute, 'your_visual_attribute_name');

9. To set an item's font bold.

SET_ITEM_PROPERTY('emp.ename', font_weight, font_bold);

10. Set a tooltip text for a push button.

SET_ITEM_PROPERTY('control.savebutton', tooltip_text, 'Click to Save');

See also:

This Post Has 3 Comments

  1. usman
    SET_ITEM_PROPERTY('emp.ename', prompt_text, 'Employee Name: ');
    its not working .
    1. Vinish Kapoor

      The syntax is correct, you have to check yourself why it is not working.

    2. Hany Elagaty
      set_item_property('emp.ename' ,PROMPT_TEXT ,'Employee Name: ');
      capital letters

Comments are closed.