5.1.OAFIntorductionNBasics

35
Oracle Applications Framework Course Contents OA Framework Topics Details Hours OAF Introduction and Concepts OAF History MVC architecture OAF, D2K Comparison BC4J Components [ AM,EO,VO,AO] WebUI Compoents & Controller [ PG,CO] OAF/JDeveloper Directory Structure Brief : OA Exceptions – Information- Error, Java Exception Handling – Try, Catch 4 Hrs OAF Basics : Implement Search Page Exercise to understand and implement BC4J and WebUI components Debug “Hello World” from JDeveloper Display FND messages using OA Exceptions Create dependent LOV Create VO based region to Display Search Results using CO Run & Debug Search Page 4 Hrs OAF Basics : Implement DML Page Understanding Transactions in OAF Create Page in OAF Implementing Partial Page Rendering in Create Page [ PPR ] Linking Search Page and DML page [Page Context Navigation Methods ] Create Function/Menu for OAF pages deployment Deploy Search, DML Pages to server using XML Import Debugging OAF pages from oracle applications Understanding MDS [Meta Data Service] JDR tables ,JDR utilities 10 Hrs OAF Personalization Personalization Profiles Understanding Personalization as Functional Administrator ,End User Drill Down capability to DML page by Embedding custom page called Details Update Page Programmatic Control on Beans : Hide button bean using Details Update Page Implementing Function Security using SPEL Add LOV using personalization Import/Export Personalization between instances 10 Hrs OAF Extensions View Object Extension in DML page : New Column addition Entity Object Extension in DML page : Validations Controller Extension in DML Page Prepare JDeveloper for oracle std page VO extension View Object Extension in Oracle Standard Page Deploy substitutions using JPX Import JDR Utilities 8 Hrs [email protected] m 1

Transcript of 5.1.OAFIntorductionNBasics

Page 1: 5.1.OAFIntorductionNBasics

Oracle Applications Framework Course Contents

OA Framework Topics Details Hours

OAF Introduction and Concepts

OAF History

MVC architecture

OAF, D2K Comparison

BC4J Components [ AM,EO,VO,AO]

WebUI Compoents & Controller [ PG,CO]

OAF/JDeveloper Directory Structure

Brief : OA Exceptions – Information- Error, Java Exception Handling – Try, Catch

4 Hrs

OAF Basics : Implement Search Page

Exercise to understand and implement BC4J and WebUI components

Debug “Hello World” from JDeveloper

Display FND messages using OA Exceptions

Create dependent LOV

Create VO based region to Display Search Results using CO

Run & Debug Search Page

4 Hrs

OAF Basics : Implement DML Page

Understanding Transactions in OAF

Create Page in OAF

Implementing Partial Page Rendering in Create Page [ PPR ]

Linking Search Page and DML page [Page Context Navigation Methods ]

Create Function/Menu for OAF pages deployment

Deploy Search, DML Pages to server using XML Import

Debugging OAF pages from oracle applications

Understanding MDS [Meta Data Service]

JDR tables ,JDR utilities

10 Hrs

OAF Personalization Personalization Profiles

Understanding Personalization as Functional Administrator ,End User

Drill Down capability to DML page by Embedding custom page called Details Update Page

Programmatic Control on Beans : Hide button bean using Details Update Page

Implementing Function Security using SPEL

Add LOV using personalization

Import/Export Personalization between instances

10 Hrs

OAF Extensions View Object Extension in DML page : New Column addition

Entity Object Extension in DML page : Validations

Controller Extension in DML Page

Prepare JDeveloper for oracle std page VO extension

View Object Extension in Oracle Standard Page

Deploy substitutions using JPX Import

JDR Utilities

8 Hrs

OAF Advanced Java : Prepared Statement Usage in OAF

PLSQL Entity Objects

Calling OAF pages from Forms

OAF calling Web service : Concept

4 Hrs

[email protected]

Page 2: 5.1.OAFIntorductionNBasics

Oracle Applications Framework Prerequisites

Prerequisite Topics Details

Trainee Knowledge Oracle Ebiz-Suite Experience

D2K Forms Knowledge

OOPS basics

Java basics

JDeveloper must be installed in local machine [ Steps Provided Below ]

JDeveloper Installation Installation Steps [ JDeveloper installed in local machine, No steps required in server ]

Find OAF Version Set FND: Diagnostics profile value to ‘Yes’

Login to oracle apps -> Home Page

Click About Page Link -> Navigate to Technology Stack tab

Note OAF Version

Refer metalink note 416708.1 and note required patch number for your OAF version

Patch is a zip file , Download Patch to your desktop.

Extract zip to D:\JDEVELOPER

Download and extract patch Create Folder JDEVELOPER in Local Machine D Drive

Download patch to desktop

Extract downloaded patch to D:\JDEVELOPER folder

Extraction create three folders called jdevbin, jdevdoc, jdevhome

Setting Environment Variable Create environment variable ‘JDEV_USER_HOME’ in your local machine.

Set JDEV_USER_HOME to value ‘D:\JDEVELOPER\\jdevhome’

Navigation to create environment variable:

Desktop->My Computer-> Properties -> select Advanced-> press button Environment Variables -> Create variable using above values

Testing Create a shortcut to D:\JDEVELOPER\\jdevbin\jdev\bin\jdevw.exe to your desk top ,Rename Short to OAFJD

Create a folder structure D:\JDEVELOPER\jdevhome\jdev\dbcfiles\secure in local machine

Copy DBC file from your server location $FND_TOP/secure/<version> to D:\JDEVELOPER\jdevhome\jdev\dbcfiles\secure

Open JDeveloper by clicking shortcut OAFJD

Create a database connection [Steps provided below ]

Select Connections folder shown in JDeveloper -> Right Click -> New Connection -> Opens Connection Wizard

Connection Wizard :

Step 1 : Field : Connection Name Value=Oracle SID ex:VIS , Connection Type : Oracle JDBC ,Click Next

Step 2 : Field : Username = apps , Password = Database password Ex: apps , Click Next

Step 3 : Field : Drive = thin : apps , Host Name=Provide apps DB tier machine name ex: apps.oracle.com : SID= oracle SID ex:VIS, Next

Note: Host name for DB tier machine of oracle apps must be created before step3 and the same should be mentioned in step3

Step 4: Press Test Connection Button should return ‘Success’ , Click Finish to complete testing.

[email protected]

Page 3: 5.1.OAFIntorductionNBasics

On Completion this presentation you should understand • Evolution of OAF

• Future of OAF• Present of OAF

OAF EvolutionGoals

[email protected]

Page 4: 5.1.OAFIntorductionNBasics

PL/SQL Web Cartridge A pl/sql procedure builds HTML tags, and the resultant HTML is shown on the browser.HTP Package procedures used.Called using SSWA Function of oracle eBiz SuiteExample: Some HRMS pages with PL/SQL cartridges

What is next …Oracle introduced a metadata concept in form of AK DeveloperItem properties like required/prompt/LOV etc became configurableThis meta data was stored in AK% tables. Reduced the programming effort to make minor changes

Disadvantages Both static/dynamic Content & validations were programmed within the PL/SQL. Presentation and data were within the same layerEven the simplest possible change required changes to PL/SQL Code

OAF EvaluationPL/SQL HTML

[email protected]

Page 5: 5.1.OAFIntorductionNBasics

AK Developer with PL/SQL and other technologies In AK Developer Regions and Region Items can be defined using Screens. Important tables in AK Developer are AK_REGIONS and AK_REGION_ITEMS. “AK Developer” separates Data Layer from Presentation Layer. Regions within the screen and their fields can be defined using AK Developer.Examples : iProc Pages , HRMS pages

AK Developer Customizations Modify Fields Properties like Prompt, Required , Rendered , Enable DFF etc.,

OAF EvaluationAK Developer

Disadvantages of using AK DeveloperAK Developer changes are not upgrade safeAK Developer is standalone and is not integrated with jDeveloper, No IDEAK Developer Shared Regions changes are globally reflectedVery limited number of item styles were supportedAK is a proprietary technology

What is next …AK Developer is added with AK_CUSTOM% tables to store personalization to make AK developer upgrade safeOracle Applications Framework introduced to address IDE issue

[email protected]

Page 6: 5.1.OAFIntorductionNBasics

OA FrameworkOA Framework is a combination of XML, Java and Meta Data ServiceOA Framework is a IDE thru JDeveloperOA Framework is WebUI developed using XML and then loaded to MDSOA Framework using MVC architecture OA Framework Highly extensible architectureUsing OA Framework •We can create custom pages•We can personalize existing pages•We can extend existing pages

DisadvantagesWYSWUG is not availableNo drag and drop provided as other standard IDE.Too much of code and too many steps for simple tasks.MDS is a propitiatory, Not an open standard.

What is next …Fusion ! ADF !!!

Now …Welcome To Oracle Application Framework

OAF EvaluationPresent & Future

[email protected]

Page 7: 5.1.OAFIntorductionNBasics

OAF IntroductionGoals

On Completion this presentation you should understand & learn • OAF Tools & Technologies

• OAF Architecture• OAF Compoents

•OAF execution flow•jDeveloper usage for OAF

•Some useful java information to work with OAF

[email protected]

Page 8: 5.1.OAFIntorductionNBasics

OAF IntroductionUsage & Tools

Usage :•Create custom self service web pages for oracle applications•Extend oracle applications standard OAF SSW pages•Personalize oracle applications standard OAF SSW pages

Technology , Tools & Architecture:•XML Pages stored in XML format•Java: Code segments written in Java which internally can call database objects using JDBC.•Meta Data Service (MDS) Set of oracle tables which stores UI XML (webui components) information in database.•IDE OAF using jDeveloper as Integrated Development Environment for development.•MVC architecture The J2EE “Model-View-Controller” architecture is used to develop OAF SSW pages.

[email protected]

Page 9: 5.1.OAFIntorductionNBasics

OAF IntroductionMVC Architecture

MVC ArchitectureM- Model Layer – Database ObjectsV - View Layer – Web User InterfaceC – Control Layer – Code Layer responds to WebUI eventsWidely used in webpage delvelopment

[email protected]

Page 10: 5.1.OAFIntorductionNBasics

OAF IntroductionOAF Components & Onion architecture

M- Model Layer–(BC4J)Business Components for Java Objects (Server)•Entity Object (EO) = Oracle SQL Table•View Object (VO) = Oracle SQL Query •Association Object (AO) = Relations between EO,VO,AO•Application Module (AM) = Library [Access to EO,VO,AO]

V - View Layer – Web User Interface (UIX)UI XML Components (WebUI)•Page (PG) = Canvas•Page Layout Region (PLRN) = Form •Region (RN) = Block•Bean = Field

C – Control Layer – WebUI event listener (servlet)•Controller (CO) = Form Level Triggers [No access to EO,VO,AO]•processRequest method fires on page render.•processFormRequest method will be used to listen page events.•Controller will access AM code segments to perform business logic.

•Client Layers : UIX/webui and Controller •Business Layer : BC4J/server components

[email protected]

Page 11: 5.1.OAFIntorductionNBasics

OAF IntroductionExecution Flow

Open OA Page

Controller – Initialize the page using processRequest(..)

OAF Page Rendered

User Perform Action

Controller – Handle user interaction using processFormRequest(..)

[email protected]

Page 12: 5.1.OAFIntorductionNBasics

OAF IntroductionComponent creation : JDeveloper

JDeveloper IDE Objects •Workspace* Is a Private working area for OAF web components•Project* Is further grouping to your OAF components

Server Objects•Business Components for Java (BC4J)*All business compoents grouped here•Application Module (AM)*•Entity Object (EO)** -> Attach EO to AM*•View Object (VO)** -> Attach VO to AM*•Association Object (AO)** -> Attach AO to AM*

Web User Interface (WebUI) Objects•Page (PG)*•Page Layout Region (PLRN)* -> Attach AM * -> Set Controller (CO)**•Region (RN)* -> Set Controller (CO)**•Bean (txt/ btn / disp / ..)* -> (View Instance, View Attribute)**

Note:* Mandatory** Optional

[email protected]

Page 13: 5.1.OAFIntorductionNBasics

OAF IntroductionJava : Useful Information

Java Package Structure•Package is nothing but folder structure •server is the folder used to store business components and code•webui is the folder used to store user interface components and code •schema folder can be used to keep Database Objects - EO,VO,AO•Server, webui are the common folders used to group OAF components

Java : Some useful syntax information•Import java class Imports java code required , this can be equated library call in c like #Include stdio.h Ex: Import java.io.serializable•Variable creation syntax ObjectType VariableName=Value; Ex: String S1=“”;•Casting (Data Type Conversion)ObjectType1 VariableName = (ObjectType1)ObjectType2;Ex: int int1 =1;String S1=(String)int1;•Method (Procedure) Syntax<Scope> <return value> <method name>(<data type> <variablename1>,..){ code …}Public void query (String S1)(){ if (s1=null) { system.out.println(“S1 is null”) } }

[email protected]

Page 14: 5.1.OAFIntorductionNBasics

OAF IntroductionCommon Imports

Import Class Category Remarks

oracle.apps.fnd.framewrok.OAExceptions WebUI OA Exceptions

AM

VO

Dialog Pages

[email protected]

Page 15: 5.1.OAFIntorductionNBasics

On Completion this presentation you should understand • Server Components• Workspace, Project

• Business Components for Java (BC4J)• Application Module (AM)

• Web Components • Page (PG) , Page Layout Region (PLRN) , Region (RN) , Beans

• Controller (CO)• Application Module , Controller code snippets

Understanding OAF Components : Login Page Exercise Goals

[email protected]

Page 16: 5.1.OAFIntorductionNBasics

Understanding OAF Components : Login Page Exercise Design

Task•Create a login page and show messages on login failure & success•On login success navigate to home page

Design• Connection ( Oracle Components for Java – OC4J)

• Create connection dbconn

• Containers• Create workspace Excercises.jws• Create Project Excercises.jpr

• server Components ( package oracle.apps.ont.excercise.server )• Create BC4J• Create AM

• webui Components ( package oracle.apps.ont.excercise.server ) Create Page (PG) , Page Layout Region (PLRN)

• Create a Region under PLRN• Create two text beans and submit button bean• Set Controller to PLRN• Controller ProcessFormRequest Method will be coded

On Login Failure to show information message On Login Success show a dialog message and navigate to home page

[email protected]

Page 17: 5.1.OAFIntorductionNBasics

Understanding OAF Components :Login Page Exercise Oracle Components 4 Java : Connection

Step Navigation Property Value

Create Connection

Connection->

New Database Connection

1.Connection Name

2.Connection Type

3.User Name

4.Password

5.Driver

6.Host Name

7.JDBC Port

8.SID

1.DBConn2.Oracle JDBC3.Apps4.Apps schema password 5.Thin6.Localhost [ your host name]7.1521 [ Database port name , default 1521 ] 8.VIS [ Database Name , default VIS]

[email protected]

Page 18: 5.1.OAFIntorductionNBasics

Understanding OAF Components : Login Page Exercise Container Components

Step Navigation Property Value

Create Workspace

WorkSpaces->

New OA Workspace

1.Directory Name

2.Workspace Name

1.D:\jdev9i\devhome\jdev\myprojects[ $JDEV_USER_HOME]2.Excercise.jws

Create Project Excecise.jws->

New OA Project

1.Directory Name

2.File Name

3.Default Package

4.Use Repository Design Time

5.Connection

6.DBC File Name

7.User Name

8.Password

9.Application Short Name

10.Responsibility_key

1. D:\jdev9i\devhome\jdev\myprojects[ $JDEV_USER_HOME]2.Excercise.jpr3.oracle.apps.ont.excercise.webui4.Checked5.DBConn6. D:\jdev9i\devhome\jdev\dbc_files\secure\vis.dbc7.Operations8.Welcome9.ONT10.ORDER_MGMT_SUPER_USER

[email protected]

Page 19: 5.1.OAFIntorductionNBasics

Understanding OAF Components : Login Page Exercise Server Components

Step Navigation Property Value

Create BC4J Exercise.jpr ->

New Business Component package

1.Package Name

2.Connection

3.User Name

4.Password

1.oracle.apps.ont.excercise.login.server2.Training3.apps4.Apps

Create Application Module

BC4J->

New Application Module

1.Name

2.Package

3.Generate Java Files

1.testAM2.oracle.apps.ont.excercise.login.server3.Checked

[email protected]

Page 20: 5.1.OAFIntorductionNBasics

Understanding OAF Components : Login Page Exercise webui Components

Step Navigation Property Value

Create Page Excercise.jpr -> New Web Tier-OAComponents-Page

->Propery Inspector

1.Name

2.Package

1.LoginPG [ Page name should end with PG ]2.oracle.apps.ont.excercise.login.webui Note: Page auto creates a region called region1 of type PLRN

Page layout region: Properties

LoginPG -> region1 1.Name

2.Region Style

3.Application Module

4.Window Title

5.Page Title

1.LoginPLRN [ Region name should end with RN]2.PageLayout3.oracle.apps.ont.excercise.login.server.testAMNote: AM can set at PLRN/RN level4.Login Window5.Login Page

Create Region LoginPLRN-> New -> Region

1.ID

2.Region Style

1.LoginRN [ Region name should end with RN]2.Default Single Column [ Choose any Style as required]

Create text Item LoginRN-> New -> Item 1.ID

2.ItemStyle

3.Prompt

1.txtLoginName2.Message Text input3.User Name

Create text Item LoginRN-> New -> Item 1.ID

2.ItemStyle

3.Prompt

4.Secret

1.txtPassword2.Message Text input3.Password4.True

Create Submit Button

LoginRN-> New -> Item 1.ID

2.ItemStyle

3.Prompt

1.btnSubmit2.Submit3.LoginNote: Used to submit form values for server side processing

Create Controller LoginPgG -> LoginPLRN->Set New Controller

1.Package Name

2.Class Name

1. oracle.apps.ont.excercise.login.webui2.loginCO [ Controller name should end with CO]Note: Controller can set at PLRN/RN levelCheck : Controller of PLRN property should be oracle.apps.ont.excercise.login.webui.loginCO

[email protected]

Page 21: 5.1.OAFIntorductionNBasics

//Login Controller Code //Login Application Module Code

Understanding OAF Components : Login Page Exercise Controller & Application Module code snippets

[email protected]

Page 22: 5.1.OAFIntorductionNBasics

On Completion this presentation you should understand • View Objects

• Drop Down List bean•Search AM & Controller Code

Understanding OAF Components : Home Page Exercise Goals

[email protected]

Page 23: 5.1.OAFIntorductionNBasics

Understanding OAF Components : Home Page Exercise Design

Task•Create a Home Page to search employees data with search and result sections

Design• use connection,workspace,project from login page exercise• server Components ( package oracle.apps.ont.excercise.home.server )

• Create BC4J• Create homeAM

• Create positionVO for drop down list• Create empResultsVO for results region• Attach positionVO , empResultsVO to homeAM

• webui Components ( package oracle.apps.ont.excercise.home.webui )• Create Page (HomePG) , Page Layout Region (HomePLRN)

• Create a region (SearchRN) under HomePLRN• Create a drop down list bean to show position bean• Create a submit button bean to search action

• Set Controller homeCO to homePLRN• Controller processRequest Method will be coded

using execute query method on positionVO to show values in drop downlist • Controller processFormRequest Method will be coded

using execute query method on empResultsVO to process search action

[email protected]

Page 24: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page : BC4J Components Creation

Step Navigation Property Value

Create BC4J Exercise.jpr ->

New Business Component package

1.Package Name

2.Connection

3.User Name

4.Password

1.oracle.apps.ont.excercise.home.server2.DBConn3.apps4.Apps

Create Application Module

BC4J->

New Application Module

1.Name

2.Package

3.Generate Java Files

1.testAM2.oracle.apps.ont.excercise.home.server3.Checked

Create empVO View Object

BC4J->

New View Object

1.Name

2.Package

3.Query Statement

EmpVOImpl

4.Generate Java File

EmpVORowImpl

5.Generate Java File

6.Generate Accessors

1.empVO2.oracle.apps.ont.excercise.home.server3. Select employee_id,title,full_name,position_code,salary from training_employeeNote: Press test to test the query4.Checked5.Checked6.Checked

Create positionVO View Object

BC4J->

New View Object

1.Name

2.Package

3.Query Statement

EmpVOImpl

4.Generate Java File

EmpVORowImpl

5.Generate Java File

6.Generate Accessors

1.positionVO2.oracle.apps.ont.excercise.home.server3. Select distinct position_code from training_employeeNote: Press test to test the query4.Checked5.Checked6.Checked

Attach EmpVO to TestAM

TestAM->Edit Settings 1.Data Model 1.Move empVO from left pane to right pane2.Move positionVO from left pane to right pane

[email protected]

Page 25: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page : WebUI Components Creation

Step Navigation Property Value

Create Page Excercise.jpr -> New Web Tier-OAComponents-Page

->Propery Inspector

1.Name

2.Package

1.HomePG2.oracle.apps.ont.excercise.home.webui Note: Page auto creates a region called region1 of type PLRN

Page layout region: Properties

homePG -> region1 1.Name

2.Region Style

3.Application Module

4.Window Title

5.Page Title

1.homePLRN [ Region name should end with RN]2.PageLayout3.oracle.apps.ont.excercise.home.server.homeAMNote: AM can set at PLRN/RN level4.Employee Home5.Home Page

Create Region homePLRN-> New -> Region

1.ID

2.Region Style

1.SearchRN [ Region name should end with RN]2.Default Single Column [ Choose any Style as required]

Create text Item searchRN-> New -> Item 1.ID

2.ItemStyle

3.Prompt

4.Pick List View Definition

5.Pick List View Attribute

1.plPosition2.Message Choice3.Position4.oracle.apps.ont.excercise.home.server.positionVO5.PositionCode

Create Submit Button

searchRN-> New -> Item 1.ID

2.ItemStyle

3.Prompt

1.btnSearch2.Submit3.SearchNote: Used to submit form values for server side processing

Create Controller HomePG -> HomePLRN->Set New Controller

1.Package Name

2.Class Name

1. oracle.apps.ont.excercise.home.webui2.homeCO

[email protected]

Page 26: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page : AM, Controller Code Creation

EMPAM Controller Code : EMPAM ->Code Editor

Public Void empSearch(String pempno)

{

EMPVOImpl vo = EMPVOImplVO1();

vo.setWhereClause(“Ename=‘%’”+pempno+”%’” );

//vo.setWhereClause(“Ename=:1” );

//pempno="%"+pempno+"%";

//vo.setWhereCluseParams(null);

//vo.setWhereCluseParams(0,pempno);

vo.executeQuery();

}

EMPAM Controller Code : EMPAM ->Code Editor

import java.io.Serializable;

import oracle.apps.fnd.framework.OAApplicationModule;

//import oracle.apps.ont.examples.search.EMPAMImpl;

public void processRequest(OAPageContext pageContext, OAWebBean webBean)

{

super.processRequest(pageContext, webBean);

String ename = pageContext.getParameter("empnameS");

// get AM

// EMPAMImpl am = (EMPAMImpl)pageContext.getApplicationModule(webBean); //type casting

OAApplicationModule am = pageContext.getApplicationModule(webBean);

Serializable[] parameters = { ename };

am.invokeMethod(“empSearch", parameters);

}

[email protected]

Page 27: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page : Run & Debug

Run Search Page • Select Run from context Menu of SearchPG.xml• Should show below Screen • Enter an Employee Name Ex: ‘Smith’• Press Button Query• ResultsRN should display the employee rows which has Smith in its Employee Name

Debug Search Page • In EMPCO set a break point on processFormRequest method• In EMPAM set a break point on empSearch method.• Select Debug from context Menu of SearchPG.xml• Should show below Screen • Enter an Employee Name Ex: ‘Smith’• Press Button Query• Control should go to jDeveloper to method processFormRequest• Press F6 till Screen rendered with ‘Smith’ Employee information• Control should go to AM Method empSearch• Finally once code completes the resultant rows will appear on OAF screen• In Debug mode , can debug by viewing variable values, set watches , understand execution

flows

[email protected]

Page 28: 5.1.OAFIntorductionNBasics

On Completion this presentation you should understand •External LOV region

•Attaching LOV region to a LOV bean of parent page•Dependant External LOV bean based on value passed form parent page

•Dependent LOV controller code

Understanding OAF Components : External LOV Exercise Goals

[email protected]

Page 29: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page LOV: Overview

Task • Modify homePG searchRN to have an LOV field to fetch employee ID from an independent

external Employee LOV and populate results to resultsRN based on employeeID returned

Design & Implementation• Extend Search page to have one pick list bean for department.• Create a new DeptVO for department picklist.• Create a new EmplovVO , we can use EMPVO if it is not designed to do any DML

operations.But it is recommended by oracle to create a seaprte VO for LOVs. • Create a OAF dependent EmployeeLOV region page for employee LOV to show selected

department employees.• Create EmployeeLOVCO to add where condition to EMPVO query• Set Properties of dept pick list bean to attach DeptVO values.• Change existing enameS textbean to LOV bean.• Set properties of enames as to attach EmployeeLOVRN to search page• No changes to results region Required as it is querying based on employee name already.

[email protected]

Page 30: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page LOV: BC4J Components Creation

Step Navigation Property Value

Create deptVO BC4J

-> View Object

1.Name

2.Package

3.ExpertMode

4.Query

5.Generate Java File(s)

5A.*VOImpl

5B.*VORowImpl

1.deptVO2.oracle.apps.ont.classes.search.server3.Cheked4.Select deptname from emp

5A.Uncheck [ No need as no DML operations ]5B.Checked [Required to fetch values from database]

Create EMPVO BC4J

-> View Object

1.Name

2.Package

3.ExpertMode

4.Query

5.Generate Java File(s)

5A.*VOImpl

5B.*VORowImpl

1.empLovVO2.oracle.apps.ont.classes.search.server3.Cheked4.Select empno,ename from emp

5A.Uncheck [ No need as no DML operations ]5B.Checked [Required to fetch values from database]

Attach deptVO ,

empLovVO to EMPAM

AM->Edit Settings -> Data Model Tab

empLovVO

deptVO

1.Move EMPVO to selected View Objects list2.Move DEPTVO to selected View Objects list

[email protected]

Page 31: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page LOV: LOV Components Creation

Step Navigation Property Value

Create LOV Region & Properties

Search Project-> New -> Web Components

-> Region

1.Style

2.Name

3.Package

1.List Of Values2.EmpLovRN3.oracle.apps.ont.classes.search.webui

Set PLRN properties

region1->Properties 1.Name

2.Type

3.AM

4.Window Title

5.Page Title

1.PLRN2.Page Layout Region3.oracle.apps.classes.search.server.EMPAMImpl4.Employee List5.Employee List

Create empLovRN using Region Wizard

PLRN -> New Region using Wizard

1.AM

2.ViewObject

3.RegionID

4.RegionStyle

5.Atributes

6.AttributeProperties

1.EMPAM2.empLovVO3.empLovRN4.Table5.Move Attributes that needs to be displayed in lov6.Choose MessageStyleText and Varchar as style and datatype for all selected attributes.

Modify Properties for empLovRN

ReslutsRn->Property Inspector

1.Rendered

2.RecordsDisplayed

3.Width

4.UserPersonalization

1.True2.103.100%4.True [ to allow user to personalize this table bean ]

Set Controller to PLRN

PLRN->set New Controller

1.Name

2.Package

1.emplovCO2. oracle.apps.classes.search.server.webui

[email protected]

Page 32: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page LOV: Extend Search Page WebUI Components

Step Navigation Property Value

Modify Properties for Results RN

ReslutsRn->Property Inspector

1.Rendered

2.RecordsDisplayed

3.Width

4.UserPersonalization

1.True2.103.100%4.True [ to allow user to personalize this table bean ]

Set Controller to PLRN

PLRN->set New Controller

1.Name

2.Package

1.EMPCO2. oracle.apps.classes.search.server.webui

[email protected]

Page 33: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page : AM, Controller Code Creation

empAM Controller Code : empAM ->Code Editor

Public Void empSearch(String pempno)

{

EMPVOImpl vo = EMPVOImplVO1();

vo.setWhereClause(“Ename=‘%’”+pempno+”%’” );

//vo.setWhereClause(“Ename=:1” );

//pempno="%"+pempno+"%";

//vo.setWhereCluseParams(null);

//vo.setWhereCluseParams(0,pempno);

vo.executeQuery();

}

empLovCO Controller Code : empLovCO ->Code Editor

import java.io.Serializable;

import oracle.apps.fnd.framework.OAApplicationModule;

//import oracle.apps.ont.examples.search.EMPAMImpl;

public void processRequest(OAPageContext pageContext, OAWebBean webBean)

{

super.processRequest(pageContext, webBean);

String ename = pageContext.getParameter("empnameS");

// get AM

// EMPAMImpl am = (EMPAMImpl)pageContext.getApplicationModule(webBean); //type casting

OAApplicationModule am = pageContext.getApplicationModule(webBean);

Serializable[] parameters = { ename };

am.invokeMethod(“empSearch", parameters);

}

[email protected]

Page 34: 5.1.OAFIntorductionNBasics

OAF IntroductionSearch Page LOV: Run & Debug

Run Search Page • Select Run from context Menu of SearchPG.xml• Should show below Screen • Enter an Employee Name Ex: ‘Smith’• Press Button Query• ResultsRN should display the employee rows which has Smith in its Employee Name

Debug Search Page • In EMPCO set a break point on processFormRequest method• In EMPAM set a break point on empSearch method.• Select Debug from context Menu of SearchPG.xml• Should show below Screen • Enter an Employee Name Ex: ‘Smith’• Press Button Query• Control should go to jDeveloper to method processFormRequest• Press F6 till Screen rendered with ‘Smith’ Employee information• Control should go to AM Method empSearch• Finally once code completes the resultant rows will appear on OAF screen• In Debug mode , can debug by viewing variable values, set watches , understand execution

flows

[email protected]

Page 35: 5.1.OAFIntorductionNBasics

OAF IntroductionOAF Basics : Search Page Creation : Run and Debug

[email protected]