Search This Blog

Showing posts with label Use a Static LOV in a dropdown page. Show all posts
Showing posts with label Use a Static LOV in a dropdown page. Show all posts

Monday, June 30, 2025

How Do I Use a Static LOV in a dropdown page

 Introduction

Using a static List of Values (LOV) in a dropdown page in Oracle APEX allows you to present a fixed set of options to users in a select list. This is especially useful for fields like categories, status indicators, or levels where the choices don’t change frequently. Static LOVs improve data consistency and simplify form design by eliminating the need for dynamic SQL queries. In this blog, you’ll learn how to create and apply a static LOV to a dropdown list in a form page.

To use a static List of Values (LOV) in a dropdown page in Oracle APEX, you define a fixed set of label-value pairs that populate a select list. This type of LOV is ideal for situations where the options do not need to be pulled from a database, such as status values like "Open", "In Progress", or "Closed". Here's how to set it up step by step.

Step 1: Open Your Application and Go to the Target Page
Open Oracle APEX, select your application, and navigate to the page where you want to place the dropdown. You can use an existing form page or create a new one.

Step 2: Add a Select List Item
In Page Designer:

  • Under the appropriate region, click + to add a new item.

  • Choose Select List as the item type.

  • Set the item name, such as P1_STATUS.

  • Set the label, such as Status.

Step 3: Define the Static LOV
With the P1_STATUS item selected:

  • Scroll to the List of Values section.

  • For Type, choose Static Values.

  • In the Static Values box, enter values in this format:

Open;OPEN  
In Progress;IN_PROGRESS  
Closed;CLOSED

Each line represents one option, where the text before the semicolon is what users see (label), and the text after is what gets submitted (value).

Step 4: Configure Optional Settings
You can fine-tune how the dropdown behaves:

  • Display Null Value: Turn on if you want to show a blank first option like - Select -.

  • Null Display Value: Set the label for the blank option, e.g., - Select Status -.

  • Session State: Ensure session state is enabled so the selected value is stored and available to processes or conditions.

Step 5: Save and Run the Page
Click Save, then Run the page. You should now see a dropdown that shows the static options defined earlier.

Example Use Case
A common use of a static LOV dropdown is for selecting a risk level:

Low;LOW  
Medium;MEDIUM  
High;HIGH

This lets users pick a level easily without pulling values from a table.

Benefits of Using Static LOVs

  • Fast to implement

  • No dependency on database queries

  • Easy to maintain for small sets of fixed options

  • Great for select lists, radio groups, or checkbox groups

Static LOVs are ideal for dropdowns with consistent values across the application, giving you a simple, clean method to control user input.

Add a “select one” dropdown box and attach a “Shared components” list of values

A screen shot of a graph

Description automatically generated

Here is how it looks on the page

A screenshot of a computer

Description automatically generated

Conclusion
Implementing a static LOV in a dropdown list is a quick and effective way to guide users toward consistent input. It ensures valid selections, streamlines form usability, and reduces development complexity when dealing with predefined values. Oracle APEX makes it easy to create and assign static LOVs, allowing you to build cleaner and more user-friendly applications.