KEMBAR78
OAF Online Training Guide | PDF | Pl/Sql | Computing
0% found this document useful (0 votes)
79 views9 pages

OAF Online Training Guide

The document discusses various methods for handling events and working with view objects in Oracle Application Framework (OAF) such as buttons, poplists, LOVs, hyperlinks and images. It also provides examples of initializing view objects, adding and removing rows, and iterating through rows.

Uploaded by

Anu Chipurupally
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views9 pages

OAF Online Training Guide

The document discusses various methods for handling events and working with view objects in Oracle Application Framework (OAF) such as buttons, poplists, LOVs, hyperlinks and images. It also provides examples of initializing view objects, adding and removing rows, and iterating through rows.

Uploaded by

Anu Chipurupally
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Email: contact.leadtechnologies@gmail.

com Phone:+91 7207149158 (Telegram/Google Allo)

Contents
Events Handling 2
1. Button (SubmitButton) 2
2. PopList 2
3. LOV 2
4. HyperLink 2
5. Image 3
Methods for View Object 3
Initialization of the VO 3
1. Method to execute the VO without any bind parameter 3
2. Method to execute the VO by setting bind parameter 3
3. Adding Row Manually 3
4. Iterating the VO Using RowSetIterator 4
Removing the selected row 4
a. Using RowSetIterator 4
b. Using filteredRows Method 5
Different Ways of calling invoketMethod() 5
1. Basic InvokeMethod without params 5
2. Calling Invoke Method with String Param 5
3. Calling Invoke Method with different data types 5
PageContext Methods 6
Invoking AOL Components 6
Page Deployment 7
1. Use the below script to load PG.xml / RN.xml to MDS 7
2. List of DB Components(Tables,PLSQL-API’s) In-Respect to OAF 7
Basic Data Type Conversion Methods For Frequent Usage 7
1. Conversion of java String to java.sql.date 8
2. Comparison of dates 8

1|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)

Events Handling
1. Button (SubmitButton)
//In Below Code: “showDetails” refers to the ID of the submitButton Item
if(pageContext.getParameter("showDetails")!=null)
{
am.invokeMethod("showStudentData");
}

2. PopList
//In the belowCode “bgPopEvent” refers to the fireAction Property of the link Item
if(eventName!=null && "bgPopEvent".equals(eventName))
{
OAMessageChoiceBean bgPopIDBean =
(OAMessageChoiceBean)webBean.findIndexedChildRecursive("bgPopID");
String displayStr = bgPopIDBean.getSelectionText(pageContext) ; // Display Attribute
String valueStr = bgPopIDBean.getSelectionValue(pageContext); // Value Attribute

throw new OAException("Poplist is fired ---> Bg Name--->" + displayStr + " BG Id -->"+ valueStr,
OAException.INFORMATION) ;
}

3. LOV
//In Below Code : “orgIDLovID” refers to the ID of messageLovInput

String lovSourceID = pageContext.getLovInputSourceId();


if(lovSourceID!=null && lovSourceID.equals("orgIDLovID") )
{
OAMessageLovInputBean orgIDLovIDBean =
(OAMessageLovInputBean)webBean.findIndexedChildRecursive("orgIDLovID");
String orgIDValue = (String)orgIDLovIDBean.getValue(pageContext);
OAException exc= new OAException("Selected OrgID-->"+ orgIDValue, OAException.INFORMATION) ;
throw exc;
// throw new OAException("Selected OrgID-->"+ orgIDValue, OAException.INFORMATION) ;

4. HyperLink
//In the belowCode “imageEvent” refers to the fireAction Property of the link Item

String eventName = pageContext.getParameter(EVENT_PARAM) ;

if(eventName!=null && "linkEvent".equals(eventName) )


{
throw new OAException("User Raised an Event On Link-->", OAException.INFORMATION) ;
}

5. Image
2|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)

//In the belowCode “imageEvent” refers to the fireAction Property of the image Item

String eventName = pageContext.getParameter(EVENT_PARAM) ;

else if(eventName!=null && "imageEvent".equals(eventName) )

throw new OAException("User Raised an Event on Image -->", OAException.INFORMATION) ;

Methods for View Object


Initialization of the VO

1. Method to execute the VO without any bind parameter


// Below code has to be written in the AMImpl.java and the VO name differs based on your
project setup

public void initOeOrdersVO()

OeOrderHeadersVOImpl vo = getOeOrderHeadersVO1();

vo.executeQuery(); //OPEN operation on cursor

2. Method to execute the VO by setting bind parameter


//Method to bind the parameter to the VO
public void initPerPeopleVO()
{
String bgID = “202”;
PerPeopleVOImpl vo = getPerPeopleVO1();
vo.clearCache();
vo.setWhereClauseParam(0,bgID);
vo.executeQuery();

3. Adding Row Manually


//Below code refers to add the row in the VO Manually
public void addStudentRowManually()
{
XxcusStudentDataEOVOImpl vo = getXxcusStudentDataEOVO1();
XxcusStudentDataEOVORowImpl row = null;

row = (XxcusStudentDataEOVORowImpl)vo.createRow();
row.setNewRowState(row.STATUS_INITIALIZED);

3|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)

Number studentIDNO = getOADBTransaction().getSequenceValue("XXCUS_STUDENT_ID_S") ;


row.setId(studentIDNO);

// vo.last();
// vo.next();

vo.first();
vo.previous();

vo.insertRow(row);

4. Iterating the VO Using RowSetIterator


public void showStudentData()
{
XxcusStudentDataEOVOImpl vo = getXxcusStudentDataEOVO1();
XxcusStudentDataEOVORowImpl row = null ;

RowSetIterator rowIter = vo.createRowSetIterator("studentData") ;


while(rowIter.hasNext())
{
row = (XxcusStudentDataEOVORowImpl)rowIter.next(); ///FETCH
System.out.println("ID -->" + row.getId());
System.out.println("Sname-->"+ row.getSname());
System.out.println("SelectFlag-->"+ row.getselectFlag());
}
rowIter.closeRowSetIterator();
}

Removing the selected row

a. Using RowSetIterator
//The below logic should be written in the AMImpl.java
public void deleteStudentRows()
{
XxcusStudentDataEOVOImpl vo = getXxcusStudentDataEOVO1();
XxcusStudentDataEOVORowImpl row = null ;

RowSetIterator rowIter = vo.createRowSetIterator("studentData") ;


String empNo = null;
while(rowIter.hasNext())
{
row = (XxcusStudentDataEOVORowImpl)rowIter.next(); ///FETCH
System.out.println("ID -->" + row.getId());
System.out.println("Sname-->"+ row.getSname());
System.out.println("SelectFlag-->"+ row.getselectFlag());
String selectFlag = row.getselectFlag() ;
if(selectFlag!=null && "Y".equals(selectFlag))
{
empNo = empNo + " , " + row.getId() ;
row.remove();/// removes the data from VO
}
}

4|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)

rowIter.closeRowSetIterator();

getOADBTransaction().commit();
throw new OAException("Selected Rows Are Deleted Successfully-->"+ empNo , OAException.INFORMATION) ;

b. Using filteredRows Method


//The below logic should be written in the AMImpl.java

public void newDelteStudentRows()


{

XxcusStudentDataEOVOImpl vo = getXxcusStudentDataEOVO1();
XxcusStudentDataEOVORowImpl row = null ;
Row[] rows = vo.getFilteredRows("selectFlag","Y") ;
String empNo = "";
for(int i=0; i<rows.length;i++)
{
row = (XxcusStudentDataEOVORowImpl)rows[i];
empNo = empNo + " , " + row.getId() ;
row.remove();
}

if(rows.length>=1)
{
getOADBTransaction().commit();
throw new OAException("Selected Rows Are Deleted Successfully-->"+ empNo , OAException.INFORMATION) ;
}
else
{
throw new OAException("Please Select The Rows TO Be Deleted", OAException.ERROR) ;
}
}

Different Ways of calling invoketMethod()


1. Basic InvokeMethod without params
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("initEmployeeDetailsVO");

2. Calling Invoke Method with String Param


Serializable params[]={strUserID};
am.invokeMethod("initFormMasterVO", params);

3. Calling Invoke Method with different data types


if(pageContext.getParameter("go")!=null)
{
String fromDateStr = pageContext.getParameter("fromDate") ;
Date fromDate = stringToDate(fromDateStr);
String toDateStr = pageContext.getParameter("toDate") ;

5|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)

Date toDate = stringToDate(toDateStr);

OAMessageChoiceBean expenseTypeBean = (OAMessageChoiceBean)webBean.findIndexedChildRecursive("expenseType");


String expenseTypeStr = (String)expenseTypeBean.getSelectionValue(pageContext);
OAMessageTextInputBean expenseClaimIDBean = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("expenseClaimID");
String expenseClaimIDStr = (String)expenseClaimIDBean.getValue(pageContext);

Class paramTypes[]={Date.class, Date.class, String.class, String.class} ;


Serializable params[]= {fromDate,toDate, expenseTypeStr,expenseClaimIDStr } ;

am.invokeMethod("initExpenseDetailsVO",params, paramTypes);

PageContext Methods
Parameters passing from one page to another

Invoking PLSQL Procedure/Function/DML Statement

Invoking Concurrent Program

Invoking Workflow

PPR/SPEL Syntax

Invoking AOL Components


1. Message
a. Single Exception
throw new OAException("FND","XXCUS_CPL_SUCC_MSG",null,OAException.INFORMATION,null) ;
b. Bundled Exception

if (pageContext.getParameter("bundledExc")!=null)
{
ArrayList excArrayList = new ArrayList();

OAException exp1 = new OAException("FND","XXCUS_CPL_FIRST_MSG", null, OAException.INFORMATION,null);


OAException exp2 = new OAException("FND","XXCUS_CPL_SCND_MSG", null, OAException.INFORMATION,null);
excArrayList.add(exp1) ;
excArrayList.add(exp2) ;
OAException.raiseBundledOAException(excArrayList);

}
2. Lookup
3. Valueset
4. DFF
5. KFF

6|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)

Page Deployment

1. Use the below script to load PG.xml / RN.xml to MDS


C:\jdev\jdevbin\oaext\bin

import
C:\sridhar\jdev\jdevhome\jdev\myprojects\myprojects\moto\oracle\apps\fnd\webui\ComponentListP
G.xml -username apps -password apps -dbconnection
"(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=glo.dev.com)(PORT=1521))(CONNECT_DATA=(SID=VI
S)))" -rootDir C:\sridhar\jdev\jdevhome\jdev\myprojects

2. List of DB Components(Tables,PLSQL-API’s) In-Respect to OAF

Table Name Description

JDR_PATHS Stores document paths, packages and there parent child


relationship.
Primary Key: PATH_DOCID

JDR_COMPONENTS Stores components on documents and OA Framework pages.


Primary Key: COMP_DOCID, COMP_SEQ

JDR_ATTRIBUTES Stores attribute/properties of components on documents and


OA Framework pages.
Primary Key: ATT_COMP_DOCID, ATT_COMP_SEQ, ATT_SEQ

JDR_ATTRIBUTES_TRANS Stores translated attribute values of document components or


OA framework pages.
Primary Key: ATL_COMP_DOCID, ATL_LANG, ATL_COMP_REF,
ATL_NAME

Basic Data Type Conversion Methods For Frequent Usage


Source Data Type Target Data Conversion Sample
Type
oracle.jbo.domain.Number int Number Id = row.getId();
int idIntValue = Id.intValue();
oracle.jbo.domain.Date String Date dobDomainDate = row.getDob();
String dobStr = dobDomainDate.toString();

7|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)

1. Conversion of java String to java.sql.date


private java.sql.Date stringToDate(String dateS)
{

///String into Java.util.date


// java.util.Date into java.SQL.Date

java.sql.Date sqlStartDate = null;


if (dateS != null && !"".equals(dateS)) {
String dateFormat = "yyyy-MM-dd";
SimpleDateFormat df = new SimpleDateFormat(dateFormat);
java.util.Date parsedDate1 = null;
{
try {
parsedDate1 = df.parse(dateS); // String into DB
} catch (ParseException e) {
System.out.println("exception occurred in conversion ");
throw new OAException("Formatting Issue, Unable to Parse Data") ;
// TODO
}
sqlStartDate = new java.sql.Date(parsedDate1.getTime());

}
}
return sqlStartDate;
}

2. Comparison of dates
//Below code will compare To Date with From Date and will throw an error if it is less than from date
// compareTo method return values are : -1 , 0 , 1 for : lessthan, equalto, greater than

if(pageContext.getParameter("go")!=null)
{
String fromDateStr = pageContext.getParameter("fromDate") ;
Date fromDate = stringToDate(fromDateStr);
String toDateStr = pageContext.getParameter("toDate") ;
Date toDate = stringToDate(toDateStr);

pageContext.writeDiagnostics(this , " From Date -->" + fromDate + " To Date-->"+ toDate , 1);

if(toDate!=null && fromDate!=null )

8|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)

{
if(toDate.compareTo(fromDate) <0 )
{
throw new
OAException("XXCUS","XXDHG_SSHR_EXP_DATE_ERR",null,OAException.ERROR,null);

**this document is still under preparation, gets updated frequently.

9|Page
Email: contact.leadtechnologies@gmail.com Phone:+91 7207149158 (Telegram/Google Allo)
Refer your friends for : SQL/PLSQL, Oracle Apps Tech and OAF Online Training

You might also like