5. Creating POP List (List Item) in OAF Page

 

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.

  1. Open the New Gallery:

    • Right-click on the project RohitPopList

    • 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: RohitPopListAM

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

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

  1. Open the Application Module for Editing:

    • In the Application Navigator, locate and double-click on RohitPopListAM (or right-click and select Edit RohitPopListAM)

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

  1. Open the Page Structure:

    • In the Application Navigator, expand the RohitPopList project

    • Navigate to webui → RohitPopListPG

    • Open the page to view its structure

  2. Select the PageLayout Region:

    • In the Structure window, click on PageLayoutRN

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

  1. Create a New Region:

    • Right-click on PageLayoutRN

    • Select New → Region

  2. 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 MainRN makes 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.

  1. Create a New Item:

    • Right-click on MainRN

    • Select New → Item

    • A new item (e.g., Item1) will be created under the MainRN region

  2. Configure the Item Style:

    • Select Item1

    • In the Property Inspector, locate the ItemStyle property

    • Change the value to messagechoice

Important: Setting ItemStyle=messagechoice is what transforms a regular item into a Pop List (dropdown) component.

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

  1. Locate the Data Properties:

    • With Item1 selected, scroll down in the Property Inspector to the Data section

  2. Configure the Following Properties:

PropertyValueDescription
PickList View Definitionrohit.oracle.apps.fnd.RohitPopList.server.SupplierListVOThe View Object that provides the list data
PickList Display AttributeVendornameThe attribute displayed to the user in the dropdown
PickList Value AttributeVendorIdThe 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.

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

  1. Run the Project:

    • After successful compilation, right-click on the project RohitPopList

    • Select Run

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

PropertyPurposeExample Value
ItemStyleDetermines the type of UI componentmessagechoice
PromptLabel displayed next to the itemSupplier
PickList View DefinitionView Object that provides list data...SupplierListVO
PickList Display AttributeAttribute shown to the userVendorname
PickList Value AttributeAttribute stored on selectionVendorId

How the Pop List Works at Runtime

  1. Page Load: When the page loads, the Application Module initializes

  2. View Object Query: The SupplierListVO executes its query against the database

  3. Data Population: The Pop List is populated with the retrieved data

  4. Display: The Vendorname values are displayed in the dropdown

  5. User Selection: When the user selects a value, the corresponding VendorId is stored

  6. Form Submission: On form submission, the selected value is processed by the controller


Best Practices

PracticeDescription
Use Meaningful NamesName regions and items descriptively (e.g., MainRN, SupplierPopList)
Follow OAF StandardsKeep AM in server and pages in webui directories
Validate VO QueriesEnsure the View Object query returns the expected data
Test IncrementallyRebuild and test after each major change
Use Consistent PromptsKeep prompt labels clear and user-friendly

Troubleshooting Common Issues

IssuePossible CauseSolution
Pop List is emptyVO not attached to AMVerify SupplierListVO is added to RohitPopListAM
Page won't runAM not attached to pageAttach RohitPopListAM to PageLayoutRN
Item appears as text fieldItemStyle not setSet ItemStyle to messagechoice
Wrong values displayedDisplay/Value attributes swappedVerify PickList Display and Value attributes
Compilation errorsMissing dependenciesRebuild the project and check for errors
Runtime connection errorInvalid credentialsVerify EBS username and password

Summary

Creating a Pop List (List Item) in an OAF page involves the following key steps:

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

  2. Attach the View Object: Add the SupplierListVO to the Application Module

  3. Attach the AM to the Page: Associate RohitPopListAM with the page

  4. Create the Main Region: A container for the Pop List item

  5. Create the Pop List Item: Set ItemStyle to messagechoice

  6. Bind the View Object: Configure the PickList properties

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

No comments:

Post a Comment