16.7.2 Creating a Static List of Values at the Application-Level

Run the Create List of Values Wizard to define a named static list of values at the application-level.

Oracle APEX stores named (or shared) lists of values in the List of Values repository in Shared Components. A static list of values contains display values, return values, and the sort sequence that you specify. Once you add a list of values to the repository, you edit the item in Page Designer and select the display Type.

The following procedure demonstrates how to create a static list of values in Shared Components for the form item, Status, and then display it as a Radio Group. The following example is built on the EBA_DEMO_IR_PROJECTS table which available in the sample dataset, Project Data.

To create a named static list of values:

  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.

    Tip:

    You can also access Shared Components from Page Designer by clicking Shared Components (Shared Components) on the Page Designer toolbar.
  2. Run the Create List of Values Wizard. On the Lists of Values page, click Create.
  3. In the Create List of Values Wizard:
    1. Source:
      • Create List of Values - Specify how to create a list of values. For this example, select From Scratch.

      • Click Next.

    2. Name and Type:
      • Name - Enter a name for the list of values. For example:

        Status

      • Type - Select Static.

      • Click Next.

    3. Static Values: Enter static display and return values. For this example, enter the following
      • Sequence 1:

        • Display Value - Pending
        • Return Value - Pending
      • Sequence 2:

        • Display Value - Open
        • Return Value - Open
      • Sequence 3:

        • Display Value - On-Hold
        • Return Value - On-Hold
      • Sequence 2:

        • Display Value - Closed
        • Return Value - Closed

      Values will display in the order entered. You can display additional attributes including build option controls and item level conditional display by editing the List of Values later.

      Note:

      Return Value does not display, but is the value that is returned to the Oracle APEX engine. If you do not specify a Return Value then it is equal to the Display Value.
    4. Click Create List of Values.
      The new list of values appears on the Lists of Values page.
  4. In Page Designer, update the form item to reference the list of values:
    1. Return to Page Designer. Click Edit Page X on the Page Designer toolbar where X is the page number.
      Page Designer appears.
    2. In the Rendering tab, select the form page item. For example, select P3_STATUS.
    3. In the Property Editor, edit the following attributes:
      • Identification, Type - Select Radio Group.

      • List of Values, Type - Select Shared Component.

      • List of Values, List of Values - Select STATUS.

      • List of Values, Display Extra Values - Disable this option.

      • List of Values, Display Extra Values - Disable this option.

      Description of static_lov_page_designer.png follows
      Description of the illustration static_lov_page_designer.png
    4. Click Save and then run the page.

    As shown in the folllowing example, the form item, Status, now displays as Radio Group with four values: Pending, Open, On-Hold and Closed.

    Description of static_lov_radio_group.png follows
    Description of the illustration static_lov_radio_group.png