Master-Detail page is a very common requirement for OAF based project.This tutorial is based on Oracle's Toolbox tutorial,it has been redone and explained step by step to help beginners.Below are the step by step by approach to implement the Master Detail Page using PPR.Source code for this tutorial is available as attachement.
Note: Only registered users can download the source code and registration is free.
Have a Look at Oracle Forms Style Master Detail Page
License:
{tab=Initial Steps -->}
1. Right click Workspaces and click create new OAworkspace and name it as "CholaMasterDetail". Automatically a new OA Project is also created. Name the project as CholaMasterDetailand package as chola.oracle.apps.fnd.master.

{StickyNote}{/StickyNote}

Set the project properties as per the screenshot below:

2. We need to create two Business component package. Right click on CholaMasterDetail.jpr and click on new Business Component Package.
Name - cholamd.oracle.apps.fnd.master.server
3.Right click on cholamd.oracle.apps.fnd.master.server and click new Application Module.
Name - CholaMdAM.
Package - cholamd.oracle.apps.fnd.master.server.
{tab=VO -->}
4. Right click on cholamd.oracle.apps.fnd.master.server and click new View Object.
Name - SupplierPVO
Package - cholamd.oracle.apps.fnd.master.server.
Click Next and go to the attributes page.The VO is based on any EO.We need to create transient attributes.Click New and create the below attributes.
Name - RowKey
DataType - String
Updatable - Always
Key Attribute - Yes
Name - PoApproveReadOnly
DataType - Boolean
Updatable - Always
Name - PoApproveRequired
DataType - String
Updatable - Always
Name - PoApproveRender
DataType - Boolean
Updatable - Always
Name - PoApproveReject
DataType - Boolean
Updatable - Always
Name - DetailTableText
DataType - String
Updatable - Always
Click Next and Finish.

5.Right click on cholamd.oracle.apps.fnd.master.server and click on new View Object.
Name - SupplierSitesVO
Package - cholamd.oracle.apps.fnd.master.server.
Click Next.Go to the query page and paste the following query:
SELECT SupplierSiteEO.SUPPLIER_ID,
SupplierSiteEO.SUPPLIER_SITE_ID,
SupplierSiteEO.SITE_NAME,
SupplierSiteEO.PURCHASING_SITE_FLAG,
SupplierSiteEO.START_DATE,
SupplierSiteEO.END_DATE
FROM FWK_TBX_SUPPLIER_SITES SupplierSiteEO
Click Next and Finish.
6.Right click on cholamd.oracle.apps.fnd.master.server and click on new View Object.
Name - SuppliersVO
Package - cholamd.oracle.apps.fnd.master.server.
Click Next.Go to the query page and paste the following query:
SELECT SupplierEO.SUPPLIER_ID,
SupplierEO.NAME,
SupplierEO.ON_HOLD_FLAG,
SupplierEO.START_DATE,
SupplierEO.END_DATE
FROM FWK_TBX_SUPPLIERS SupplierEO
WHERE SupplierEO.SUPPLIER_ID <= 100
Note : Add a new attribute SelectFlag as a transient attribute.Do not forget to do this step.
Edit the AM and shuttle the SuppliersVO and SupplierSitesVO to the right side and click ok. Only then the VO instances will be accessible.
{tab=VL -->}
7.Right click on cholamd.oracle.apps.fnd.master.server and click on new View Link.
Name - SuppliertoSitesVL
Package - cholamd.oracle.apps.fnd.master.server.
8.From the source view object select SuppliersVO and from destination view object select SupplierSitesVO.Click Next.

9.Select the SupplierId from the available attributes of SuppliersVO and shuttle it to the right side.Click Next.

10.Select the SupplierId from the available attributes of SupplierSitesVO and shuttle it to the right side.Click Next.


11.Choose the cardinality for the source(SuppliersVO) as 1 and destination(SupplierSitesVO) as *.Click Next and Finish.

{tab=PG -->}
12.Right click on CholaMasterDetail.jpr and select new. Click on web tier and then OA Components and select Page.
Name - CholaMasterDetailPG
Package - cholamd.oracle.apps.fnd.master.webui.

13.Select the CholaMasterDetailPG and go to the strcuture pane where a default region has been created.
14. Select region1 and set the following properties:
ID - PageLayoutRN
AM Definition - cholamd.oracle.apps.fnd.master.server.CholaMdAM
Window Title - Master Detail Page Demo
Title - Master Detail Page Demo
15.Right click on PageLayoutRN and select new Region.
Name - MasterDetailRN
Region Style - Header
16.Right click on MasterDetailRN and select new Region Using Wizard.
17.From the droplist select the CholaMdAM and then SuppliersVO1.Click Next.

18.Set the RegionID as SuppliersTable and RegionStyle as Table.
19.Shuttle all the attributes to the right side and click next.
20.Change the Style of all the attributes to messageStyledText.Click Next and Finish.
Right click on SuppliersTable and select new - > singleSelection.Set the following properties for the singleSelection:
View Instance - SuppliersVO1
View Attribute - SelectFlag
Action Type - firePartialAction
Event - supplierSelect
21.Right click on SuppliersTable and click new singleSelection.Set the following properties:
View Instance - SuppliersVO1
View Attribute - SelectFlag
Action Type - firePartialAction
Event - supplierSelect
21.Select MastersDetailRN and select new Region.
23.Set the RegionID as SupplierSitesHeader and RegionStyle as header.
24.Right click SupplierSitesHeader and select new Region Using Wizard.
25.From the droplist select the CholaMdAM and then SupplierSitesVO1.Click Next.

26.Set Name as SupplierSitesHeader and RegionStyle as Table.Click Next.
27.Shuttle all the attributes to the right side and click next.
28.Change the Style of all the attributes to messageStyledText.Click Next and Finish.
{tab=CO -->}
29.Right click on the PageLayoutRN in the page and select Set new Controller.
Name- MasterDetailCO
Package - cholamd.oracle.apps.fnd.master.webui

Import Statements:
| Import Statements | |
1 |
import oracle.apps.fnd.common.VersionInfo; |
Code:
{slide=ProcessRequest}
1 |
OAHeaderBean sitesHeader = |
{slide=ProcessFormRequest}
1 |
OAApplicationModule am = |
{/slide}
{tab=AM Code -->}
Include the two methods in CholaMdAMImpl.java file.
handleSupplierSelectionEvent:
1 |
public void handleSupplierSelectionEvent() |
initializePPRExamplePage:
1 |
public void initializePPRExamplePage() |
{tab=Save and Run }
{/tabs}