16a. Partial Rendering in OAF Page (Conditional Displaying Any Item)

 

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?

BenefitDescription
Improved PerformanceOnly the affected portion of the page is refreshed, not the entire page
Better User ExperienceFaster response times and smoother interactions
Dynamic BehaviorFields can be enabled, disabled, shown, or hidden based on user input
Real-Time ValidationValidations can be applied without a full page submission
Reduced Server LoadLess 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:

#ActivityPurpose
1Create Application Module (AM)Container that manages access to the model objects
2Create View Object (VO)Provides data access and query capabilities
3Create Page Object (PG)The user interface component
4Create 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

  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: RohitPartialRendring

    • Click OK


Step 2: Configure the Project

  1. Project Wizard:

    • The Project Wizard opens automatically

    • Click Next to proceed

  2. Enter Project Details:

    • Project Name: RohitPartialRendring

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

  1. Open the New Gallery:

    • Right-click on the project RohitPartialRendring

    • Select New

  2. Select Application Module:

    • Navigate to Business Tier → ADF Business Components

    • Select Application Module

    • Click OK

  3. Configure the Application Module:

    • Application Module Name: RohitPartialRendringAM

    • Default Package: rohit.oracle.apps.fnd.RohitPartialRendring.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

Important: Every OAF page must be associated with an Application Module. Without this association, the page cannot run.


Step 4: Create the OAF Page

  1. Open the New Gallery:

    • Right-click on the project RohitPartialRendring

    • Select New

  2. Select Page:

    • Navigate to Web Tier → JSF/Faces (or Web Tier → Oracle ADF Faces)

    • Select Page

    • Click OK

  3. Configure the Page:

    • Page Name: RohitPartialRendringPG

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

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

  1. Complete the Page Creation:

    • Click OK to create the page


Step 5: Configure the PageLayoutRN Region

  1. Rename the Default Region:

    • In the Structure pane, click on region1

    • In the Property Inspector, change the ID to PageLayoutRN

  2. Attach the Application Module:

    • With PageLayoutRN selected, locate the AM Definition property

    • Set it to:

      text
      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:

text
┌─────────────────────────────────────────────────────────────────┐
│                        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

StepActionDescription
1User interacts with a fieldUser changes a checkbox, selects a dropdown value, etc.
2PPR event firesThe field's firePartialAction event is triggered
3Controller processes the eventprocessFormRequest detects the event source
4Dynamic behavior appliedFields are enabled/disabled, shown/hidden, or updated
5Partial page refreshOnly the affected portion of the page is refreshed

Directory Structure Overview

After completing Part 1, your project will have the following structure:

text
RohitPartialRendring/
├── server/
│   └── RohitPartialRendringAM.xml (Application Module)
└── webui/
    └── RohitPartialRendringPG.xml (OAF Page)

Note: The server directory contains server-side business logic components. The webui directory contains the user interface components.


Best Practices

PracticeDescription
Use Meaningful NamesName regions and items descriptively
Follow OAF StandardsKeep AM in server and pages in webui
Plan PPR EventsDecide which fields will trigger PPR events before building the page
Test IncrementallyRebuild and test after each major change
Use DiagnosticsAdd writeDiagnostics calls for debugging
Handle Edge CasesConsider what happens when no field is selected

Troubleshooting Common Issues

IssuePossible CauseSolution
Page won't runAM not attachedAttach RohitPartialRendringAM to PageLayoutRN
PPR event not firingWrong event nameVerify the event name matches in item and controller
Fields not updatingPPR code not in correct blockEnsure PPR logic is in processFormRequest
Compilation errorsMissing importsAdd necessary imports for OAException, etc.
Page refreshes completelyPPR not configuredVerify 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:

  1. Adding Items to the Page: Creating the fields that will participate in PPR

  2. Configuring PPR Events: Setting up firePartialAction on items

  3. Writing the PPR Logic: Implementing the controller code to handle dynamic behavior

  4. Enabling/Disabling Fields: Applying dynamic properties based on user input

  5. Showing/Hiding Regions: Controlling visibility based on selections

  6. Testing the PPR Behavior: Verifying that the page responds dynamically


Summary

Partial Page Rendering (PPR) in OAF begins with the following foundational steps:

  1. Create the Workspace: Set up the development environment

  2. Configure the Project: Use proper package naming conventions

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

  4. Create the OAF Page: The user interface component

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

No comments:

Post a Comment