How to Create a List of Values (LOV) in an OAF Page
Introduction
A List of Values (LOV) is a powerful UI component in Oracle Application Framework (OAF) that allows users to search for and select a value from a predefined list, typically sourced from a database query. LOVs are widely used in both custom OAF pages and when extending standard Oracle E-Business Suite pages—for example, to select a supplier, customer, or employee from a large dataset.
Creating an LOV in OAF requires building several interconnected objects: a View Object to fetch the data, a Region with a ListOfValue style to define the LOV popup, and finally wiring it all together on the page. Because the process is lengthy, this guide is split into two parts.
Part 1 (this article): Creating the workspace, project, page, Application Module, View Object, and LOV Region.
Part 2: Attaching the LOV to an item, configuring the search region, and running the page.
Prerequisites
Before you begin, ensure the following:
Oracle JDeveloper is installed and configured with a valid Runtime Connection
Database Connection is established (see the JDev Installation guide)
You have an EBS user account with the necessary responsibilities
Basic familiarity with creating workspaces, projects, and Application Modules in JDeveloper
Step 1: Create a New Workspace
Start the Workspace Wizard:
Right-click on Applications in the Application Navigator
Select New OA Workspace
Name the Workspace:
Enter the workspace name: RohitLovCreation
Click OK
Project Wizard:
The Project Wizard opens automatically
Click Next to proceed
Step 2: Configure the Project
Enter Project Details:
Project Name:
RohitLovCreationDefault Package:
rohit.oracle.apps.fnd.RohitLovCreation
Important: The package name determines the directory structure where Java class files and other project files are stored. The
oracle.apps.fndportion is mandatory for OAF development. Thefndabbreviation represents the Oracle Application short name (you can use other application short names likeakas appropriate).
Enter Runtime Connection Details:
Provide your Oracle E-Business Suite Username and Password
These are the same credentials you configured during JDev installation
Complete the Wizard:
The workspace and project are now created
Step 3: Create the OAF Page
Open the New Gallery:
Right-click on the project RohitLovCreation
Select New
Select Page:
In the New Gallery, navigate to Web Tier → JSF/Faces (or Web Tier → Oracle ADF Faces)
Select Page
Click OK
Configure the Page:
Page Name:
RohitLovCreationPGDefault Package:
rohit.oracle.apps.fnd.RohitLovCreation.webui
Note: Pages are always created under the webui directory of the project, following OAF standards.
Rename the Default Region:
When the page is created, a default region (e.g., region1) is generated
In the Structure pane, select region1
In the Property Inspector, change the ID to PageLayoutRN
Important: An OAF page cannot run without an Application Module. The next step creates the AM that will be attached to this page.
Step 4: Create the Application Module
Open the New Gallery:
Right-click on the project RohitLovCreation
Select New
Select Application Module:
In the New Gallery, navigate to Business Tier → ADF Business Components
Select Application Module
Click OK
Application Module Wizard:
Click Next to proceed
Configure the Application Module:
Application Module Name:
RohitLovCreationAMDefault Package:
rohit.oracle.apps.fnd.RohitLovCreation.server
Note: Application Modules are always created under the server directory of the project, following OAF standards.
Complete the Wizard:
Click Next, then click Finish
The Application Module is now created
Step 5: Create the View Object (SupplierVO)
The View Object provides the data that will populate the LOV. In this example, we will create a View Object to display supplier information.
Open the New Gallery:
Right-click on the project RohitLovCreation
Select New
Select View Object:
In the New Gallery, navigate to Business Tier → ADF Business Components
Select View Object
Click OK
Configure the View Object:
View Object Name:
SupplierVODefault Package:
rohit.oracle.apps.RohitLovCreation.lov.server
Tip: Since this View Object is specifically for the LOV, create a separate lov directory under the project directory. This keeps LOV-related objects organized and easy to identify.
Define the Query:
Click Next through the wizard
At Step 5 (Query), enter the SQL query that will retrieve supplier data. For example:
SELECT vendor_id, vendor_name FROM ap_suppliers WHERE NVL(disabled_flag, 'N') = 'N'
Continue through the wizard and click Finish
Note: The View Object query determines what data appears in the LOV. Ensure the query returns the columns you need for both display and value attributes.
Step 6: Create the LOV Region (SupplierRG)
The LOV Region defines the popup window that appears when the user clicks the LOV icon. It uses the ListOfValue region style.
Open the New Gallery:
Right-click on the project RohitLovCreation
Select New
Select Region:
In the New Gallery, navigate to Web Tier → JSF/Faces (or Web Tier → Oracle ADF Faces)
Select Region
Click OK
Configure the Region:
Region Name:
SupplierRGDefault Package:
rohit.oracle.apps.RohitLovCreation.lov.webuiRegion Style:
ListOfValue
Important: Setting the Region Style to
ListOfValueis what transforms a standard region into an LOV popup window. This is the defining characteristic of an LOV region.
Complete the Region Creation:
Click OK to create the region
The LOV region is now created
Understanding the LOV Architecture
Creating an LOV in OAF involves several interconnected components, each with a specific role:
| Component | Purpose | Example |
|---|---|---|
| View Object (VO) | Fetches the data for the LOV | SupplierVO |
| LOV Region | Defines the popup window and search criteria | SupplierRG (Style = ListOfValue) |
| Application Module | Container that manages access to the VO | RohitLovCreationAM |
| Page | The main page where the LOV item is placed | RohitLovCreationPG |
| Item | The field that triggers the LOV popup | (Created in Part 2) |
How the Components Work Together
User Clicks the LOV Icon: The user clicks the LOV icon next to a field on the page
LOV Popup Opens: The LOV Region (
SupplierRG) opens as a popup windowData Retrieval: The View Object (
SupplierVO) executes its queryResults Displayed: The query results are displayed in the LOV popup
User Selects a Value: The user selects a row and clicks OK
Value Returned: The selected value is returned to the page item
Directory Structure Overview
After completing Part 1, your project will have the following structure:
RohitLovCreation/
├── server/
│ └── RohitLovCreationAM.xml (Application Module)
├── lov/
│ ├── server/
│ │ └── SupplierVO.xml (View Object for LOV)
│ └── webui/
│ └── SupplierRG.xml (LOV Region)
└── webui/
└── RohitLovCreationPG.xml (OAF Page)Note: Organizing LOV-related objects in a dedicated
lovdirectory keeps the project clean and maintainable, especially when multiple LOVs are used in a single project.
Best Practices
| Practice | Description |
|---|---|
| Organize LOV Objects | Keep LOV View Objects and Regions in a dedicated lov directory |
| Use Meaningful Names | Name VOs and Regions descriptively (e.g., SupplierVO, SupplierRG) |
| Optimize Queries | Ensure VO queries are efficient and return only necessary columns |
| Filter Data | Apply appropriate WHERE clauses to exclude disabled or irrelevant records |
| Follow OAF Standards | Keep AM in server, pages in webui, and LOV objects in lov |
| Test Incrementally | Verify each object (VO, Region, AM) before moving to the next |
Troubleshooting Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| LOV region doesn't appear | Wrong region style | Verify Region Style is set to ListOfValue |
| No data in LOV | VO query returns no rows | Test the SQL query directly against the database |
| VO not available | Not added to Application Module | Add SupplierVO to RohitLovCreationAM |
| Page won't run | AM not attached | Attach RohitLovCreationAM to PageLayoutRN |
| Compilation errors | Missing dependencies | Rebuild the project and check for errors |
| Package name error | Missing oracle.apps.fnd | Ensure package includes the required prefix |
What's Next (Part 2)
Now that you have created the foundational objects, Part 2 of this guide will cover:
Adding an Item to the Page: Creating the field that will use the LOV
Setting Item Properties: Configuring the item to display the LOV
Attaching the LOV Region: Linking the item to the
SupplierRGregionConfiguring Search Criteria: Setting up the LOV search and results columns
Rebuilding and Running: Compiling and testing the complete LOV functionality
Summary
Creating a List of Values (LOV) in an OAF page involves the following key steps:
Create the Workspace: Set up the development environment
Configure the Project: Use proper package naming conventions
Create the OAF Page: The user interface component
Create the Application Module: The mandatory container for model objects
Create the View Object: Define the SQL query for LOV data
Create the LOV Region: Define the popup window with
ListOfValuestyle
By completing Part 1, you have established all the foundational objects required for an LOV. The View Object provides the data, the LOV Region defines the popup interface, and the Application Module manages access to these objects. In Part 2, you will wire these components together on the page to create a fully functional LOV that users can interact with.
This modular approach to LOV creation—separating data retrieval (VO), presentation (LOV Region), and integration (Page Item)—reflects the MVC architecture that underpins OAF development, making your applications more maintainable and scalable.
References
Oracle E-Business Suite Documentation: OA Framework Developer's Guide
Oracle JDeveloper Documentation: Available in the
jdevdocfolderOracle Application Framework: Official Oracle documentation
No comments:
Post a Comment