6. How to Create the LOV in OAF Page

 

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

  1. Start the Workspace Wizard:

    • Right-click on Applications in the Application Navigator

    • Select New OA Workspace

  2. Name the Workspace:

    • Enter the workspace name: RohitLovCreation

    • Click OK

  3. Project Wizard:

    • The Project Wizard opens automatically

    • Click Next to proceed


Step 2: Configure the Project

  1. Enter Project Details:

    • Project Name: RohitLovCreation

    • Default 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.fnd portion is mandatory for OAF development. The fnd abbreviation represents the Oracle Application short name (you can use other application short names like ak as appropriate).

  1. Enter Runtime Connection Details:

    • Provide your Oracle E-Business Suite Username and Password

    • These are the same credentials you configured during JDev installation

  2. Complete the Wizard:

    • The workspace and project are now created


Step 3: Create the OAF Page

  1. Open the New Gallery:

    • Right-click on the project RohitLovCreation

    • Select New

  2. Select Page:

    • In the New Gallery, navigate to Web Tier → JSF/Faces (or Web Tier → Oracle ADF Faces)

    • Select Page

    • Click OK

  3. Configure the Page:

    • Page Name: RohitLovCreationPG

    • Default Package: rohit.oracle.apps.fnd.RohitLovCreation.webui

Note: Pages are always created under the webui directory of the project, following OAF standards.

  1. 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

  1. Open the New Gallery:

    • Right-click on the project RohitLovCreation

    • Select New

  2. Select Application Module:

    • In the New Gallery, navigate to Business Tier → ADF Business Components

    • Select Application Module

    • Click OK

  3. Application Module Wizard:

    • Click Next to proceed

  4. Configure the Application Module:

    • Application Module Name: RohitLovCreationAM

    • Default Package: rohit.oracle.apps.fnd.RohitLovCreation.server

Note: Application Modules are always created under the server directory of the project, following OAF standards.

  1. 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.

  1. Open the New Gallery:

    • Right-click on the project RohitLovCreation

    • Select New

  2. Select View Object:

    • In the New Gallery, navigate to Business Tier → ADF Business Components

    • Select View Object

    • Click OK

  3. Configure the View Object:

    • View Object Name: SupplierVO

    • Default 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.

  1. Define the Query:

    • Click Next through the wizard

    • At Step 5 (Query), enter the SQL query that will retrieve supplier data. For example:

      sql
      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.

  1. Open the New Gallery:

    • Right-click on the project RohitLovCreation

    • Select New

  2. Select Region:

    • In the New Gallery, navigate to Web Tier → JSF/Faces (or Web Tier → Oracle ADF Faces)

    • Select Region

    • Click OK

  3. Configure the Region:

    • Region Name: SupplierRG

    • Default Package: rohit.oracle.apps.RohitLovCreation.lov.webui

    • Region Style: ListOfValue

Important: Setting the Region Style to ListOfValue is what transforms a standard region into an LOV popup window. This is the defining characteristic of an LOV region.

  1. 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:

ComponentPurposeExample
View Object (VO)Fetches the data for the LOVSupplierVO
LOV RegionDefines the popup window and search criteriaSupplierRG (Style = ListOfValue)
Application ModuleContainer that manages access to the VORohitLovCreationAM
PageThe main page where the LOV item is placedRohitLovCreationPG
ItemThe field that triggers the LOV popup(Created in Part 2)

How the Components Work Together

  1. User Clicks the LOV Icon: The user clicks the LOV icon next to a field on the page

  2. LOV Popup Opens: The LOV Region (SupplierRG) opens as a popup window

  3. Data Retrieval: The View Object (SupplierVO) executes its query

  4. Results Displayed: The query results are displayed in the LOV popup

  5. User Selects a Value: The user selects a row and clicks OK

  6. 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:

text
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 lov directory keeps the project clean and maintainable, especially when multiple LOVs are used in a single project.


Best Practices

PracticeDescription
Organize LOV ObjectsKeep LOV View Objects and Regions in a dedicated lov directory
Use Meaningful NamesName VOs and Regions descriptively (e.g., SupplierVO, SupplierRG)
Optimize QueriesEnsure VO queries are efficient and return only necessary columns
Filter DataApply appropriate WHERE clauses to exclude disabled or irrelevant records
Follow OAF StandardsKeep AM in server, pages in webui, and LOV objects in lov
Test IncrementallyVerify each object (VO, Region, AM) before moving to the next

Troubleshooting Common Issues

IssuePossible CauseSolution
LOV region doesn't appearWrong region styleVerify Region Style is set to ListOfValue
No data in LOVVO query returns no rowsTest the SQL query directly against the database
VO not availableNot added to Application ModuleAdd SupplierVO to RohitLovCreationAM
Page won't runAM not attachedAttach RohitLovCreationAM to PageLayoutRN
Compilation errorsMissing dependenciesRebuild the project and check for errors
Package name errorMissing oracle.apps.fndEnsure 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:

  1. Adding an Item to the Page: Creating the field that will use the LOV

  2. Setting Item Properties: Configuring the item to display the LOV

  3. Attaching the LOV Region: Linking the item to the SupplierRG region

  4. Configuring Search Criteria: Setting up the LOV search and results columns

  5. 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:

  1. Create the Workspace: Set up the development environment

  2. Configure the Project: Use proper package naming conventions

  3. Create the OAF Page: The user interface component

  4. Create the Application Module: The mandatory container for model objects

  5. Create the View Object: Define the SQL query for LOV data

  6. Create the LOV Region: Define the popup window with ListOfValue style

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 jdevdoc folder

  • Oracle Application Framework: Official Oracle documentation

No comments:

Post a Comment