Creating a Pop List (List Item) in an OAF Page
Introduction
Pop Lists (also known as List Items or Dropdown Lists) are essential UI components in Oracle Application Framework (OAF) pages. They allow users to select a single value from a predefined list of options. This guide is the second and final part of creating a Pop List in an OAF page. It assumes you have already created the page structure and View Object in Part 1, and now focuses on creating the Application Module, attaching the View Object, adding the Pop List item to the page, and configuring it for runtime.
Prerequisites
Before proceeding, ensure the following:
Part 1 of this guide is complete (the OAF page RohitPopListPG and the View Object SupplierListVO have been created)
Oracle JDeveloper is installed and configured with a valid Runtime Connection
The project RohitPopList exists in your workspace
Step 1: Create the Application Module
Since the Application Module (AM) was not created in Part 1, we must create it now so it can be attached to the RohitPopListPG page.
Open the New Gallery:
Right-click on the project RohitPopList
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:
RohitPopListAMDefault Package:
rohit.oracle.apps.fnd.RohitPopList.server
Note: Application Modules are always created under the server directory of the project, following OAF standards. This separates server-side business logic from the user interface.
Complete the Wizard:
Click Next, then click Finish
The Application Module is now created
Step 2: Attach the View Object to the Application Module
The View Object (VO) must be added to the Application Module so that it can be accessed by the page at runtime.
Open the Application Module for Editing:
In the Application Navigator, locate and double-click on RohitPopListAM (or right-click and select Edit RohitPopListAM)
Add the View Object:
In the editor that opens, locate SupplierListVO in the Available View Objects list on the left-hand side
Shuttle SupplierListVO to the right-hand side (Selected View Objects)
Click Next, then click Finish
Important: Without adding the View Object to the Application Module, the Pop List will not be able to retrieve data at runtime.
Step 3: Attach the Application Module to the Page
For the page to function, it must be associated with an Application Module.
Open the Page Structure:
In the Application Navigator, expand the RohitPopList project
Navigate to webui → RohitPopListPG
Open the page to view its structure
Select the PageLayout Region:
In the Structure window, click on PageLayoutRN
Attach the Application Module:
In the Property Inspector (right-hand side), locate the Application Module property
Select RohitPopListAM from the dropdown list
Alternatively, use the Attach Application Module option in the right-click context menu
Note: Every OAF page must be associated with an Application Module. Without this association, the page cannot run.
Step 4: Create the Main Region
Regions are containers that hold items and other regions. We will create a main region to hold our Pop List item.
Create a New Region:
Right-click on PageLayoutRN
Select New → Region
Rename the Region:
A new region (e.g., region2) will be created
In the Property Inspector, change the ID property to MainRN
Tip: Using meaningful names like
MainRNmakes your page structure easier to understand and maintain.
Step 5: Create the Pop List Item
Now we will create the Pop List item within the MainRN region.
Create a New Item:
Right-click on MainRN
Select New → Item
A new item (e.g., Item1) will be created under the MainRN region
Configure the Item Style:
Select Item1
In the Property Inspector, locate the ItemStyle property
Change the value to messagechoice
Important: Setting
ItemStyle=messagechoiceis what transforms a regular item into a Pop List (dropdown) component.
Set the Prompt:
In the Property Inspector, locate the Prompt property
Enter: Supplier
Note: The Prompt is the label that appears next to the Pop List on the page, telling the user what the list represents.
Step 6: Bind the View Object to the Pop List
Now we must connect the Pop List item to the View Object so it can display data.
Locate the Data Properties:
With Item1 selected, scroll down in the Property Inspector to the Data section
Configure the Following Properties:
| Property | Value | Description |
|---|---|---|
| PickList View Definition | rohit.oracle.apps.fnd.RohitPopList.server.SupplierListVO | The View Object that provides the list data |
| PickList Display Attribute | Vendorname | The attribute displayed to the user in the dropdown |
| PickList Value Attribute | VendorId | The attribute stored when a selection is made |
Explanation:
PickList View Definition: Tells the Pop List which View Object to use as its data source
PickList Display Attribute: The field the user sees in the dropdown (e.g., supplier name)
PickList Value Attribute: The underlying value associated with the selection (e.g., supplier ID)
Step 7: Rebuild and Run the Project
After configuring the Pop List, you must rebuild the project and run it to see the results.
Rebuild the Project:
Right-click on the project RohitPopList
Select Rebuild
Note: Rebuilding compiles all Java classes and ensures there are no errors before deployment.
Run the Project:
After successful compilation, right-click on the project RohitPopList
Select Run
Verify the Output:
The page should open in your default web browser
You should see the Supplier Pop List with the list of vendor names
Selecting a value should store the corresponding Vendor ID
Understanding the Pop List Configuration
| Property | Purpose | Example Value |
|---|---|---|
| ItemStyle | Determines the type of UI component | messagechoice |
| Prompt | Label displayed next to the item | Supplier |
| PickList View Definition | View Object that provides list data | ...SupplierListVO |
| PickList Display Attribute | Attribute shown to the user | Vendorname |
| PickList Value Attribute | Attribute stored on selection | VendorId |
How the Pop List Works at Runtime
Page Load: When the page loads, the Application Module initializes
View Object Query: The SupplierListVO executes its query against the database
Data Population: The Pop List is populated with the retrieved data
Display: The
Vendornamevalues are displayed in the dropdownUser Selection: When the user selects a value, the corresponding
VendorIdis storedForm Submission: On form submission, the selected value is processed by the controller
Best Practices
| Practice | Description |
|---|---|
| Use Meaningful Names | Name regions and items descriptively (e.g., MainRN, SupplierPopList) |
| Follow OAF Standards | Keep AM in server and pages in webui directories |
| Validate VO Queries | Ensure the View Object query returns the expected data |
| Test Incrementally | Rebuild and test after each major change |
| Use Consistent Prompts | Keep prompt labels clear and user-friendly |
Troubleshooting Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| Pop List is empty | VO not attached to AM | Verify SupplierListVO is added to RohitPopListAM |
| Page won't run | AM not attached to page | Attach RohitPopListAM to PageLayoutRN |
| Item appears as text field | ItemStyle not set | Set ItemStyle to messagechoice |
| Wrong values displayed | Display/Value attributes swapped | Verify PickList Display and Value attributes |
| Compilation errors | Missing dependencies | Rebuild the project and check for errors |
| Runtime connection error | Invalid credentials | Verify EBS username and password |
Summary
Creating a Pop List (List Item) in an OAF page involves the following key steps:
Create the Application Module: The mandatory container for model objects
Attach the View Object: Add the SupplierListVO to the Application Module
Attach the AM to the Page: Associate RohitPopListAM with the page
Create the Main Region: A container for the Pop List item
Create the Pop List Item: Set ItemStyle to
messagechoiceBind the View Object: Configure the PickList properties
Rebuild and Run: Compile and test the page
By following these steps, you have successfully created a functional Pop List in your OAF page. This component allows users to select from a predefined list of values, providing a clean and efficient way to capture user input. The same principles apply to creating other list-based components, such as combo boxes and radio groups, making this a foundational skill for OAF development.
References
Part 1: Creating the Page and View Object for the Pop List
Oracle E-Business Suite Documentation: OA Framework Developer's Guide
Oracle JDeveloper Documentation: Available in the
jdevdocfolderOracle Application Framework: Official Oracle documentation
Blog Reference: https://rpforacle.blogspot.in/2013/03/creating-pop-list-list-item-in-oaf-page.html
No comments:
Post a Comment