Part 1: Partial Page Rendering in an OAF Page
Introduction
Partial Page Rendering (PPR) is one of the most powerful and widely used features in Oracle Application Framework (OAF). It allows you to dynamically update specific parts of an OAF page without refreshing the entire page, providing a smoother and more responsive user experience.
PPR is commonly used to:
Display OAF page items dynamically based on user actions
Apply validations to OAF page fields
Set field properties dynamically (enable, disable, show, hide)
Implement business logic that responds to user input in real time
By placing Partial Page Rendering code in the OAF page controller, you can control how the page behaves based on user interactions, all without a full page refresh.
Note: This topic is lengthy, so it is split into two parts:
Part 1 (this article): Creating the workspace, project, Application Module, and OAF page
Part 2: Implementing the PPR logic in the controller and testing the behavior
Part 2 Reference:
https://docodi.blogspot.com/p/26b-part2-partial-rendering-in-oaf.html
Why Use Partial Page Rendering?
| Benefit | Description |
|---|---|
| Improved Performance | Only the affected portion of the page is refreshed, not the entire page |
| Better User Experience | Faster response times and smoother interactions |
| Dynamic Behavior | Fields can be enabled, disabled, shown, or hidden based on user input |
| Real-Time Validation | Validations can be applied without a full page submission |
| Reduced Server Load | Less data is transferred between the client and server |
Common Use Cases
Enabling or disabling a field based on a checkbox selection
Showing or hiding a region based on a dropdown value
Populating a field based on another field's value
Applying validation rules dynamically as the user types
Updating a dependent LOV based on a parent LOV selection
The Four Key Activities for PPR
To implement Partial Page Rendering in an OAF page, you need to complete four key activities:
| # | Activity | Purpose |
|---|---|---|
| 1 | Create Application Module (AM) | Container that manages access to the model objects |
| 2 | Create View Object (VO) | Provides data access and query capabilities |
| 3 | Create Page Object (PG) | The user interface component |
| 4 | Create Controller (CO) | Handles user interactions and PPR logic |
Note: In this guide, we focus on the AM, PG, and CO. The View Object is created as needed based on the data requirements of the page.
Prerequisites
Before you begin, ensure the following:
Oracle JDeveloper is installed and configured with a valid Runtime Connection
Database Connection is established
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: RohitPartialRendring
Click OK
Step 2: Configure the Project
Project Wizard:
The Project Wizard opens automatically
Click Next to proceed
Enter Project Details:
Project Name:
RohitPartialRendringDefault Package:
rohit.oracle.apps.fnd.RohitPartialRendring
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 Application Module (AM)
The Application Module is the container that manages access to the BC4J model objects. It provides the connection between the page and the View Object.
Open the New Gallery:
Right-click on the project RohitPartialRendring
Select New
Select Application Module:
Navigate to Business Tier → ADF Business Components
Select Application Module
Click OK
Configure the Application Module:
Application Module Name:
RohitPartialRendringAMDefault Package:
rohit.oracle.apps.fnd.RohitPartialRendring.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
Important: Every OAF page must be associated with an Application Module. Without this association, the page cannot run.
Step 4: Create the OAF Page
Open the New Gallery:
Right-click on the project RohitPartialRendring
Select New
Select Page:
Navigate to Web Tier → JSF/Faces (or Web Tier → Oracle ADF Faces)
Select Page
Click OK
Configure the Page:
Page Name:
RohitPartialRendringPGDefault Package:
rohit.oracle.apps.fnd.RohitPartialRendring.webui
Note: Pages are always created under the webui directory of the project, following OAF standards.
Complete the Page Creation:
Click OK to create the page
Step 5: Configure the PageLayoutRN Region
Rename the Default Region:
In the Structure pane, click on region1
In the Property Inspector, change the ID to PageLayoutRN
Attach the Application Module:
With PageLayoutRN selected, locate the AM Definition property
Set it to:
rohit.oracle.apps.fnd.RohitPartialRendring.server.RohitPartialRendringAM
Important: Every OAF page must be associated with an Application Module. Without this association, the page cannot run.
Understanding the PPR Architecture
Partial Page Rendering in OAF works through the following components:
┌─────────────────────────────────────────────────────────────────┐
│ OAF PAGE │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ PageLayoutRN (AM: RohitPartialRendringAM) │ │
│ │ ┌─────────────────────────────────────────────────┐ │ │
│ │ │ MainRN │ │ │
│ │ │ ┌─────────────────────────────────────────┐ │ │ │
│ │ │ │ Item1 (Checkbox) │ │ │ │
│ │ │ │ Item2 (Text Input - dependent) │ │ │ │
│ │ │ └─────────────────────────────────────────┘ │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ └─────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ CONTROLLER │
│ 1. processRequest: Initial page setup │
│ 2. processFormRequest: Handles PPR events │
│ - Detects the source of the PPR event │
│ - Applies dynamic behavior (enable/disable, show/hide) │
└─────────────────────────────────────────────────────────────────┘How PPR Works
| Step | Action | Description |
|---|---|---|
| 1 | User interacts with a field | User changes a checkbox, selects a dropdown value, etc. |
| 2 | PPR event fires | The field's firePartialAction event is triggered |
| 3 | Controller processes the event | processFormRequest detects the event source |
| 4 | Dynamic behavior applied | Fields are enabled/disabled, shown/hidden, or updated |
| 5 | Partial page refresh | Only the affected portion of the page is refreshed |
Directory Structure Overview
After completing Part 1, your project will have the following structure:
RohitPartialRendring/
├── server/
│ └── RohitPartialRendringAM.xml (Application Module)
└── webui/
└── RohitPartialRendringPG.xml (OAF Page)Note: The
serverdirectory contains server-side business logic components. Thewebuidirectory contains the user interface components.
Best Practices
| Practice | Description |
|---|---|
| Use Meaningful Names | Name regions and items descriptively |
| Follow OAF Standards | Keep AM in server and pages in webui |
| Plan PPR Events | Decide which fields will trigger PPR events before building the page |
| Test Incrementally | Rebuild and test after each major change |
| Use Diagnostics | Add writeDiagnostics calls for debugging |
| Handle Edge Cases | Consider what happens when no field is selected |
Troubleshooting Common Issues
| Issue | Possible Cause | Solution |
|---|---|---|
| Page won't run | AM not attached | Attach RohitPartialRendringAM to PageLayoutRN |
| PPR event not firing | Wrong event name | Verify the event name matches in item and controller |
| Fields not updating | PPR code not in correct block | Ensure PPR logic is in processFormRequest |
| Compilation errors | Missing imports | Add necessary imports for OAException, etc. |
| Page refreshes completely | PPR not configured | Verify the item's firePartialAction property is set |
What's Next (Part 2)
Now that you have created the workspace, project, Application Module, and OAF page, Part 2 of this guide will cover:
Adding Items to the Page: Creating the fields that will participate in PPR
Configuring PPR Events: Setting up
firePartialActionon itemsWriting the PPR Logic: Implementing the controller code to handle dynamic behavior
Enabling/Disabling Fields: Applying dynamic properties based on user input
Showing/Hiding Regions: Controlling visibility based on selections
Testing the PPR Behavior: Verifying that the page responds dynamically
Summary
Partial Page Rendering (PPR) in OAF begins with the following foundational steps:
Create the Workspace: Set up the development environment
Configure the Project: Use proper package naming conventions
Create the Application Module: The mandatory container for model objects
Create the OAF Page: The user interface component
Configure the PageLayoutRN: Rename the default region and attach the AM
Why PPR Matters
Partial Page Rendering is essential for building modern, responsive OAF pages because it:
Eliminates Full Page Refreshes: Only the affected portion of the page is updated
Improves Performance: Reduces server load and network traffic
Enhances User Experience: Provides immediate feedback without page flicker
Enables Dynamic Behavior: Allows fields to respond to user input in real time
Supports Complex Business Logic: Enables validations and conditional logic without full submissions
By mastering PPR, you can create OAF pages that are both functional and responsive, meeting the high standards of Oracle E-Business Suite user experience.
References
Part 1: Partial Page Rendering in OAF — https://docodi.blogspot.com/p/16a-partial-rendering-in-oaf-page.html
Part 2: Partial Page Rendering in OAF (Continued) — https://docodi.blogspot.com/p/26b-part2-partial-rendering-in-oaf.html
Oracle E-Business Suite Documentation: OA Framework Developer's Guide
Oracle JDeveloper Documentation: Available in the
jdevdocfolderRelated Guides: Creating a Hello World Page in OAF, Creating an LOV in OAF, Creating a Search Page in OAF
No comments:
Post a Comment