16.4 Creating Lists of Values at the Application-Level

Create a static or dynamic list of values (LOV) at the application-level which can be referenced by page items or report fields.

Tip:

To learn about defining a column as a list of values, go to Developing Reports and find the “Defining a Column as a List of Values” discussion under the appropriate report type.

16.4.1 What is a List of Values?

A list of values (LOV) is a static or dynamic definition used to display a specific type page item.

A LOV can be static, meaning it is based on values the user enters or dynamic, meaning it is based on a Local data source, REST Enabled SQL Reference, or REST Data Source. A LOV can be referenced by page items such popup lists of values, a select list, a checkbox, a radio group, or multiple select lists.

By creating a list of values at the application-level, you are creating shared component. Creating a LOV as a shared component has several advantages:

  • You can add it to any page within an application.

  • All LOV definitions are stored in one location, making them easy to locate and update.

  • You can define LOVs on different data sources and make use of new functionality only included in Shared LOVs, for example multi-column support, icon and grouping columns.

16.4.2 Creating a Named LOV at the Application-Level

You define named (or shared) LOVs at the application-level by running the Create LOV Wizard and adding them to the List of Values repository.

All LOVs can be defined as static or dynamic. Static lists are based on predefined pairs of display values and return values. Dynamic list of values retrieve data from a Local data source, REST Enabled SQL reference, or REST Data Source.

To create a named LOV:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.
      The Shared Components page appears.
  2. Under Other Components, select List of Values.

    The Lists of Values page appears.

  3. To create a LOV, click Create.
  4. Follow the on-screen instructions.

    New named LOVs are added to the List of Values repository. To add the LOV to a page, you must edit the appropriate item or column and select the named LOV.

16.4.3 About Static LOVs

Static LOVs are based on a static list of display values and return values you specify when you run the Create LOV Wizard.

To create a static LOV, run the Create LOV Wizard and select the LOV type Static. Oracle APEX stores the display values, return values, and sort sequence you specify in the List of Values repository. Once you add a static LOV to the repository, you can create an item and display it as a checkbox, radio group, select list, or popup list based on this definition.

16.4.4 Editing an Existing LOV

To edit an existing LOV, select the LOV on the Lists of Values page.

16.4.4.1 Editing a LOV

To edit a LOV:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.
      The Shared Components page appears.
  2. Under Other Components, select List of Values.
    The Lists of Values page appears.
  3. Select an LOV.
    The Edit page appears.
  4. Edit the attributes.

    Tip:

    To learn more about an attribute, see field-level Help.

  5. Click Apply Changes.

16.4.4.2 Editing LOVs in Bulk

You can edit the display values of all static LOVs by clicking the Grid Edit button on the Edit List of Values page.

To perform a bulk edit of static LOVs:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.

      The Shared Components page appears.

  2. Under Other Components, select List of Values.

    By default, LOVs display as icons.

  3. Click the Grid Edit tab.
  4. Edit the display text and click Apply Changes.

16.4.5 About Referencing Session State Within an LOV

You can reference session state in an LOV by using bind variables.

Keep in mind that referencing session state makes an LOV a bit less reusable, but is still a recommended development practice. In the following example, this LOV only works if the item called my_deptno contains a valid department number.

SELECT ename, empno FROM emp WHERE deptno = :P1_DEPTNO

16.4.6 Accessing LOV Reports

Access LOV reports by selecting a report on the List of Values page.

To access LOV reports:

  1. Navigate to the Shared Components page:
    1. On the Workspace home page, click App Builder.
    2. Select an application.
    3. On the Application home page, click Shared Components.
      The Shared Components page appears.
  2. Under Other Components, select List of Values.

    By default, LOVs display as icons.

  3. Select one of the following tabs at the top of the page:
    • List of Values - Displays all LOVs that are defined locally with the definition of an item. LOVs that are usable by multiple pages can be converted into shared lists of values. Converting locally defined lists of values into a shared list of values promotes reuse.
    • Edit Null Text - Edit null text for all LOVs in your application.
    • Locally Defined - View all lists of values that are defined locally with the definition of the item. Lists of values that are usable by multiple pages can be converted into shared lists of values. Converting locally defined lists of values into a shared list of values promotes reuse..
    • Grid Edit - Find and edit static list of value entries over all static lists of values. Use this page to standardize display text.
    • Conditional Entries - Displays all LOVs that display conditionally.
    • Subscription - Displays all subscribed LOVs in your application.
    • Utilization - Displays where LOVs used in the current application.
    • History - Displays displays recent modifications made to lists of values in in the current application.
  4. Follow the on-screen instructions.