Академический Документы
Профессиональный Документы
Культура Документы
OAF
OAF
OAF
Chapter 1: Introduction
What is OAF
Oracle Application Framework (OA Framework or OAF) is a framework developed by Oracle Corporation for
application development within the Oracle E-Business Suite (EBS)
Oracle Application Framework (OAF) provides visual and declarative approaches to Java EE development.
The OA framework is also available to customers for personalizations, customizations and custom-application
development.
The OA Framework helps to create self Service pages in Oracle EBS.
The OA Framework helps in controlling the flow of the application.
OA Framework works on the basic Java EE principles.
To Learn OAF you must know the Basics of Java like Core Java.
User Interface is Very Interactive in OAF
OA Framework contains inbuilt security
We can view OA Framework pages in mobile phones too which contains Internet browsing feature
OA Framework is J2EE based but it also supports various standards like HTML, XML, SQL, JSP.
Necessary to use OAF In Oracle Apps:
The necessary to use OAF in Oracle applications is Integration, Security, and Customization.
OAF
Oracle FORMS
OAF
Structure of OAF
Let us discuss about the structure of OAF.
OAF follows J2EE Architecture and J2EE follows MVC architecture so therefore ultimately OAF follows MVC
Architecture.
MVC is the clean design interface between Model, View, and Controller.
Model will take care the Data Base related Transactions, Model contains the following:
View is nothing but the OAF Page Output. View is implemented by UIX (User Interface XML).
Controller will take care of web browser activities like HTTP Get and HTTP Post
Controller have got three methods:
Process Request
Process Forms Request (HTTP Get)
Process Form Data (HTTP Post)
HTTP get: While loading the Page we use HTTP Get.
HTTP Post : After Loading the page if we want any changes the we use HTTP Post.
We will discuss in detail about MVC architecture in the next chapters.
OAF
OAF
The Below figure shows the interaction between Model, View, and Controller.
OAF
OAF
iv) More R&D is required to design a form layout which is time consuming.
About Model
The entire Database related transactions in OAF pages will be taken care by the MODEL.
Callable Statement
Application Module
Model contains six components including BC4J components, additionally the other three components are:
Prepare Statement
OADB Transactions
Callable statement is used to call a PL/SQL statements, Prepare statements are used if we are using single
SELECT statement, and OADB transactions will take care of Oracle APPS related Data Base transactions.
OAF
The entity objects are used if one wishes to do some insert/update operations.
Entity Objects represents a Data Base Row of a table.
Entity Objects will be based on the View (Oracle View), Synonyms or snapshots.
We need to create Entity Object if we want to perform DML operations on the OAF Page.
All the Entity Objects end with the EO.
Example: employeeEO
Note that we have two types of tables in Oracle Apps they are Custom Tables and Seeded Tables.
If we want to perform the DML operations on the standard (Seeded) table then we go for PL/SQL based Entity
Object and if we want to perform the DML operations on the custom table then we go for Java Based Entity
Object.
Entity Association
Entity Association is the relationship between two Entity Objects having one common column.
All the Entity Association ends with the AO (Association Object).
Example: EmpDeptAO
If we want to perform DML operations on Master Detail page then we go for Entity Association.
If we want to common know column between two tables then we will go for Entity Association.
OAF
View Objects
View Objects are used where we want some data to be displayed on page.
View Objects are used just for displaying purpose.
View Objects access the result set of a SQL statement, it can be either based on the Entity Object or plain SQL
query.
All the view objects ends with the VO
Example: employeeVO
When we create the View Object (VO) one subclass will generate with setters and getters method.
Manual VO: If we are writing our own SQL query then it will be called as Manual VO.
Automatic VO: Automatic VO is when we select an Entity Object automatically it will select the Query.
OAF
If we want to perform DML operations then we can go for VO that should be based on Entity Object.
We go for Manual VO if we are using simple SELECT statement.
NOTE: Note that when we create VO (View Object) all the table columns will be converted into attributes,
hence here we call columns as attributes.
Validation VO:Validating the data in the Data Base, example using WHERE condition in the SELECT statement.
Property VO:Attributes / columns without Data Base columns comes under property VO. These attributes are
also called as Transient attributes.
Example: Suppose there is a table which holds student marks so therefore it contains 6 columns to hold six
subject marks for each student. There is no total column in the table to store the total marks of the student
separately. Now in the output for display purpose we are taking TOTAL attribute hence which is not from Data
Base table and this TOTAL attribute is called Transient attribute.
View Links
Relationship between two View Objects having one common column in both the VOs is called View Link. All the
View Link objects end with the VL
Example: DeptEmpVL
Note that if we want to display Master Detail data then we go for View Links, where as if we want to perform
DML operations on Master Detail data we go for Entity Association.
The below figure shows that how View Objects and View Links are interacting with Data Base, VO interacts with
Data Base Directly or VO interacts with Data Base through the EO.
Application Module
Every Oracle Application Framework (OAF) page should be attached to some Application Module.
It is the interface between the Client transactions and Data Base transactions.
All the application module objects end with AM.
Example: employeeAM
OAF
OAF
The View Objects containing in the Main Application Module can be used anywhere in the child regions or
Nested Application Module.
If the View Objects are attached to the Nested Application Module then those view objects are applicable only
to that particular nested region.
OAF
About View
View is the actual output OAF page what an end user can able to see.
In Oracle Apps Framework View is implemented using UIX technology, whereas UIX means User Interface XML.
Whenever we run the page in JDeveloper then automatically UIX will generate web.xml file.
The power of UIX is that allows metadata to be translated to an HTML page for a web browser or mobile device
browsers.
The generated web.xml file will be converted into HTML format of OAF page.
Whenever we want to move the web.xml file into the server side then MDS repository is used to move the
web.xml file into the server.
MDS stands for Meta Data Service and in the application top we will be having MDS folder.
OAF
When we deploy all the OAF page destination paths, regions then the files will be stored into the MDS tables.
JDR_Paths:Stores the path of the documents, OA Framework pages and their parent child relationship.
JDR_Components:Stores components on documents and OA Framework pages.
JDR_Attributes:Stores attributes of components on documents and OA Framework pages.
JDR_ATTRIBUTES_TRANS:Stores translated attribute values of document components or OA framework
pages.
JDR_DOCUMENT_ID_S: This is a sequence generator table.
BC4J of AM and VO
BC4J of EO
BC4J of LOV
BC4J of poplist
BC4J of Controller
BC4J of Page
OAF
OAF
Step 1: If we observe we will find an option called About this Page in OAF Page. Click on the link About this
Page. The same process is shown in the below figure:
Sometimes you may not find an option called About this Page, for that you need to set one Profile Option in
Oracle Apps. The name of the profile option is Personalize Self-Service Defn. Switch to the responsibility,
System Administrator.
The navigation to select the profile option is:
System Administrator -> Profile -> System
The same navigation is shown in the below figure:
OAF
After that select the Display level as Site and down in the Profile give name like Persolalize%Self%, the same
scenario is shown in the below figure:
OAF
After entering, click on Find button then you can see full profile option name. At site level select YES option to
activate About this Page link in the Oracle apps Framework page. The same scenario is shown in the below
figure:
OAF
Step 2: After selecting About This page we can see another window, in that select a tab called Technology
Components and after selecting that tab we can see the option called OA Framework which shows the
version name of OA Framework. The same scenario is shown in the below figure which is showing the version
number as 12.1.3.
OAF
Step 3: Now you need to download the JDeveloper patch of the version which we identified in Technology
Components. All the patches we can download from Oracle Meta link, and the file size is 500+ MB. The below
table lists some patches related to the versions:
Oracle Apps Release Version
JDeveloper Patch
12.1.0
Patch 7315332
12.1.1
Patch 8431482
12.1.2
Patch 9172975
12.1.3
OAF
Patch 9879989
Extract the ZIP file and open the patch folder you will find three folders, as shown in the below figure contains
jdevbin, jdevdoc, jdevhome:
OAF
In the next step open jdevbin folder in that you will find a jdev folder again open jdev folder the you can see
bin folder, after that if you observe we can find jdev and jdevW icons. The jdev is for UNIX environment and
jdevW is for Windows environment. The same scenario is shown in the below figure stepwise:
OAF
OAF
OAF
Let us discuss how to configure JDeveloper in our system, we are here discussing in Windows environment step
wise.
Step 1: First step is we need to set the Jdev environment variables for windows. Go to environment variable in
windows properties. Right Click on Computer/My Computer select properties. The same scenario is shown in
the below figure.
Select Advanced System Settings after choosing the Properties of Computer, the same scenario is shown in
the below figure:
OAF
Now in the top User Variables select New Button for adding a New User variable as show in the below figure:
OAF
Note that you must give Variable name as JDEV_USER_HOME and Variable Value is the path of the
jdevhome\jdev. Let us consider as a example I downloaded the patch and extracted it to Bharath\Softwares in
D: drive now my path for Variable value is:
D:\Bharath\Softwares\p9879989_R12_GENERIC\jdevhome\jdev
The same thing is shown in the below figure:
OAF
Step 2: After setting Variable name and Variable value we need to select DBC file into from Oracle Apps fnd
top, copy DBC file and paste it in JDeveloper patch.
To know where exactly the DBC file is located in Oracle Apps go to About this Page and select Java System
Properties tab then in the list we can find an System Property called DBC FILE, in the Value behind to DBC FILE
is the path where exactly the DBC file located in the Oracle Apps.
The same scenario is shown in the below figure:
OAF
Step 3: After finding where exactly the DBC file located go to that particular path and copy the DBC file (note
that dont delete the dbc file and also dont cut it).
Here we are using WinScp which connects to the server from our desktop system, we can also use putty to
connect to the server or any other tool which works similar like WinScp or Putty connection manager.
Install WinScp and the following figure shows the icon how it look like:
While giving path name directly dont give /naora1.dbc, according to the above figure give the path as
/u01/apps1/inst/apps/naora1_naapps/appl/fnd/12.0.0/secure
After giving path you will find DBC file just copy it, the same scenario is shown in the below figure:
OAF
After copying in your desktop system go to the jdevhome folder , then jdev, next dbc_files, and then next
secure, here we will not find any files or documents the folder is empty now we need to paste the DBC file
which we copied from the Oracle Apps Instance Server.
The following figures shows the same scenario:
Step 4: After pasting the DBC file now open the JDeveloper and create the Data Base Connection. After
opening the file it will ask for Configure File Type Associations, on check box check all the available types to
associate with JDeveloper. The below figure shows how the opening page looks like:
OAF
Step 5: Create a data base connection, go to Connections tab after that Right Click on Data Base folder and
then select New Database Connection, the same scenario is shown in the below figure:
OAF
After selecting New Database Connection Welcome to the create Data Base connection window opens simply
click on Next button. After that give the Connection Name here in the below figure if we observe the connection
name is NewtonApples, and the Connection Type must be Oracle (JDBC)
OAF
Click on next button after giving Connection Name, in the next window it asks for username and password give
Toad/Oracle SQL Developer tool connection name. The same scenario is shown in the below figure:-
OAF
After giving Username and Password click on the Next button, now you need to give connection details all the
connection details we even can find in DBC file, to check those detail open the DBC file with notepad there you
can find Host Name , JDBC Port, and Service Name. Give appropriate names and note that Driver type is thin.
OAF
Now after giving proper names click on the Next button we can find Test Connection button click on the Test
Connection button to check the connection is success or not.
OAF
OAF
After selecting Default Project Properties from Tools menu, in the highlighted Project Properties extract Oracle
Applications and select Run time Connection.
The same scenario is shown in the below figure:
OAF
The below figure shows the example showing DBC file path, User Name, Password, Application Short Name,
Responsibility Key. Just have a look into the picture.
OAF
OAF
Now give the File Name for Java Work Space, for example Welcome as shown in the below figure:
OAF
After giving File Name click on the OK button. After clicking on OK button button we can see Welcome window
to Oracle Applications Project Wizard.
Click on Next button, then we can see a window which asks for Project Name, give the project name for
example Welcome PRJ, Give the Default Package, for example
newtonapples.oracle.apps.po.welcomeprj.webui.
OAF
Click on Next > button, again click on Next > button then we can see. In Step 3 of 3 of Oracle Applications
Project Wizard we can see Connection details and Responsibility details which we added early in JDeveloper
Configuration Steps.
Click Next > and then Finish.
Step 2: After creating WorkSpace and Project we can see the +Welcome Project structure below to
Applications. Extract project (Welcome) and WorkSpace then we will find three folders namely
1. Application Sources
2. Resources
3. Web Content
Now, Create New Application Muduleby giving Right click on Resources you can select an option called New
Application Mudule
The same scenario is shown in the picture format:
OAF
OAF
Click on Next so that we will see Create Application Module as shown below. In the below figure observe that
we not yet changed the package name and also not specified the name for Application Mudule. Extends we can
see in extensions chapters.
OAF
If we observe in the above figure we not yet changed the package name for Application Mudule (AM). To see
the package structure we can see in the chapter BC4J file structure. So now we need to change the package
name from webui toserver and give name for the Application Module.
For example:
OAF
Click on Next > Button we will see Create Application Module Step 2 of 4 window no need to do any changes
here keep as it is and click on Next > Button again.
OAF
After clicking on Next button we will see Create Application Module Step 3 of 4 window here to no need to do
any changes simply again click on Next > button to move to another step.
OAF
After clicking on Next button without any changes we can see the below window and make sure that
Application Mudule Class:<nameof AM+impl> Generate Java File(s) check box must be checked. By default it is
checked if not just click on the box to Check.
Click on Next > button again or even we can click on Finish button here.
OAF
Step 3: Now we need to create a page and attach it to the Application Module (AM). Let us see how to create
a page and how to attach it to the AM step wise:
Creating a Page
To create a page Right click on Resources and select New (ctrl+N) as shown in the below picture:
OAF
After selecting New option a New Gallery window gets open and left side in Categories extract Web Tier and
select OA Components after selecting OA Components from Web Tier select Page from Items list. The same
similar kind of scenario is shown in the below figure:
OAF
Click on OK button after selecting Page from the Items list, after that it will ask for the details of the page give
the name of a page and just check the Package generally no need to change. Click on OK button after giving
Name.
Now a page will be created with the given name. Check the Applications Navigator structure, Extract
Application Sources Folder, extract the Package and also extract Project, server, webui we can see the names
of AM, Page , and Project what we created, in the below figure PO is the short name of the Responsibility ->
Purchasing, Vision Operations (USA).
OAF
Step 4: Now we need to attach page to the AM, for that follow the following steps:
select the .xml page from the structure Webui
Down in the page structure (WelcomePG.xml Structure) select region1.
Change the ID value in the Property Inspector (note that the 3rd step is not mandatory if we want we can
ignore it as of now)
Select BC4J in Property Inspector and then select AM Definition click on the icon
Definition.
OAF
to select the AM
OAF
Now the last step is running the Program to see the output for that select the .xml page name Applications
Navigator and then Right Click on .xml page ( for example WelcomePG.xml ) and then later
select Run (
)option.
The output of our page is as follows, have a look in to the below picture:
OAF
OAF
OAF
Step 3:
Open the page which is already created ( example Welcome Page ), here we are taking the Welcome page
which is already created in the previous chapter.
Select the .xml page from Applications Navigator, and we know that we can see the page structure after
selecting .xml page if you didnt find the page structure then use the keyword Ctrl+Shift+s or go to View ->
Structure to select the Page structure palette.
In the page structure select CorporateBrandingImage.
In the Property Inspector of corporateBrandingImage we can see Image URL in Visual field as shown in the
below figure:
OAF
just remove the .gif file name and give the appropriate name i.e,. give the logo name which ever is move to
OA_MEDIA directory. For example look into the below figure:
OAF
Note that still now we not yet moved our sample or welcome page to the Oracle Apps Server instance so there
fore if we run the program then we cannot see the logo. To see the corporate branding image locally move the
image to the folder OA_MEDIA so that we can see the corporate branding image in OAF pages.
the OA_MEDIA folder will be available in the following path
<patchfile_folder>\jdevhome\jdev\myhtml\OA_MEDIA
Now run the page so that we can see our Corporate logo in the OAF Pages as shown below:
OAF
After that select the item which we created just by clicking or selecting item, Property Inspector will be
highlighted in the Property Inspector select Item Style as image as shown in the below figure:
OAF
Now after selecting Item Style as image now select the visual field in properties and give the image path which
you want to display in Image URI field as shown in the below figure. Note that we need to move the image as
usually to the respective OA_MEDIA folder/Directory.
OAF
Run the page and see the output we can find the images as shown below:
OAF
By default JDeveloper takes it as a Header region. We got different types of regions available in the
JDeveloper, which are:
1. advancedSearch
2. advancedTable
3. bulletedList
4. cellFormat
5. contentContainer
6. contentFooter
7. defaultDoubleColumn
8. defaultFormStack
9. defaultSingleColumn
10. defaultStack
11. flexibleLayout
12. flowLayout
13. gantt
14. graphTable
15. hGrid
16. header
17. hideShow
18. hideShowHeader
19. labeledFieldLayout
20. messageComponentLayout
21. navigationBar
22. pageButtonBar
23. popUp
24. query
25. rowLayout
26. shuttle
OAF
27. stackLayout
28. sub TabLayout
29. switcher
30. table
31. tableLayout
32. train
33. tree
Give some text in Visual -> Text:, for example Header Region text field as shown in the below figure:
Run the page after giving Text field value and see the output the output will look like:
OAF
In the output observe how the Header Region is appearing and how it looks like we will discuss some important
regions which we generally use in OAF pages in the coming chapters.
OAF
OAF
OAF
Now create one more item but create it on the pageID so that let us see how the items are going to be
displayed in the output, note that we dont know how the items appear in the page at design time and how the
output looks like.
Right Click on the pageID of page structure and then select New -> Item as shown in the below figure:
OAF
After that for the created item3 in Property Inspector give the promt (for example Item1 in the Main page
:)
The same thing is shown in the below figure:
OAF
Now run the page and see how the page looks like.
The output of the page will look like the following, and observe how the items are displaying in header region
and how they are looking out of header region.
OAF
After adding Region under region here we are creating four items and Item style of all the four items is
message Text Input .
After adding Region and Items the page structure will look like:
OAF
(if you want to know how to change the prompt values in the Property Inspector see the Previous
Chapter which shows how to change the prompt value)
Prompt
item1 -> User ID
item2 -> User Name
item3 -> Responsibility ID
item4 -> Responsibility Name
The below picture shows how the output structure looks like after running the page, just have a look into it
OAF
Now we need to create a Controller, let us see how to create a controller in JDeveloper (OAF).
Best practice is to create the controller Globally so that it should be applicable to all the child regions.
Right Click on the Main Region and then select Set New Controller
After choosing Set New Controller, one dialog box window opens and it shows some default package and also
some default name, in Package name at last generally we will find .webui.webui change it to single webui
OAF
i.e,. nothing but remove one webui from the default package name, for example assume the defualt pakcage is
as follows:
newtonapples.oracle.apps.po.welcomeprj.webui.webui
change it to
newtonapples.oracle.apps.po.welcomeprj.webui
If you want to know why webui is there at end means you can see the BC4J file Structure lesson which displays
the file structures.
give the class name and we know that every controller ends with CO. For example give the controller name as
WelcomeCO as shown below:
Click on OK button after giving Class Name and also after deleting one webui from the package. Now if you
observe Applications Navigator structure controller is created under webui. Select the controller
(WelcomeCO.java) and see the java program how it looks.
In the java program WelcomeCO class is created which is extending OAControllerImpl which contains main
method.
the above method is used whenever we want any logic to be implemented before the page gets loaded. It
means while loading a page if we want to display (or) perform any business logic then we go
for processRequest.
OAF
this method is used if we want any changes to be made once after the page gets loaded, i.e,. after the page is
loaded suppose after clicking on particular button if we want to display the result into another item or after
clicking on button if we want to go to another page.
As of now our requirement is to display the User ID, User Name, Responsibility ID, Responsibility Name
whenever page gets loaded automatically all the fields to be displayed in the respective items. So therefore we
need to write our program logic in the processRequest.
Look at the below figure we declared four variables of type String and if you observe for number/id values we
are just converting those values into the string. In the OAPageContext we will be having some defined values
which we can access as shown in the below figure using notation dot (.) we will get all the available values and
then we need to choose the required one.
OAF
pageContext is nothing but the variable name of the OAPageContext (OracleApps page Context), if you
observe to declared four variables we assigned values respectively.
Now after declaring variables and assigning values to the variables, we need to search for a items in our page,
if you observe we created four items item1, item2, item3, and item4. So therefore to find the items in the page
we need to use the bean as follows:
Here in this lesson we are not providing access to copy and paste the code of java, because whenever we are
typing code JDeveloper prompts us to import the packages automatically. For example look at the below figure
whenever we start typing, JDeveloper prompts us to click on Alt-Enter so that we can import the required
package. It just saves our typing time of importing a package.
After clicking on Alt-Enter it displays the packages list then choose the required import package. Here we are
typing OAMessageTextInput it is a bean if you observe we used item style as MessagetextInput we are just
adding OA (OracleApps) at the beginning and Bean at last which gives our Bean name. Now look at the below
figure which shows the imported package name:
OAF
If you observe first we initialized a bean and at the time of initialization we also need to import the respective
package and hence now we know that how to import automatically the required package. After that declare a
variable and we used java typecasting process here .
Every item has its own id so we used id value of the item to find the required item in the page.
Similarly write the code to find all the items in the page which we created.
Now after finding the items in the page we need to assign values which we got using pageContext into the
respective items. It means we need to set a value for each item in the page and for that we use the line code
as follows:
Similarly set values to all the items and after that the code looks like:
OAF
OAF
Rebuild the program after finishing the code, just Right click on the code area and then select Rebuild option or
we can also use a short cut code Alt+Shift+f9. Same scenario is shown in the below figure:
OAF
After successfully rebuilding the java program Run the page and see the output. The output of the page which
we created is as follows:
OAF
OAF
After creating region change the region style to MessageComponentLayout in the property Inspector as
shown in the below figure:
OAF
Observe the property inspector and in the visual we added 1 to the rows and 3 to the columns, to see how this
rows and columns effect. See the output and observe the items how they are placed by JDeveloper
automatically, for that first create items under MessageComponentLayout region, here we created 5 items
under the message component layout region and then after creating see the structure of the page how it looks
like:
OAF
Give the prompt names to each items and remember here we are taking item style as messageTextInput for
all the items, run the page and see the output to see how the items are placed in message Component Layout
region:
Follow the next lesson which shows Header Region how it looks like.
Header Region
In previous lesson we learned how the Message Component Layout region looks like and how to create it, now
using the same page here in this lesson we are going to see how the Header Region looks like and what are the
properties available in the Header region in JDeveloper.
Header Region Creation
Right click on the main region and select the New -> Region as shown in the below figure:
OAF
Select the region style as Header and if we observe in the visual area we can provide Text, give some text like
Header Region and while when comparing this header region with the message component layout region we
can observe that in message component layout region we don,t have a option to provide Heading text where as
in Header region we can provide headings but item control is not there like rows and columns in
MessageComponentLayout Region.
The below figure shows the property inspector of Header Region just have a look:
Now after creating Header region create three items with Item Style as MessageTextInput:
OAF
OAF
Similarly create two more items to see the items arrangement in Header Region, and note that for all the items
the item style is MessageTextInput.
Give some prompt names to all the items:
After creating three items the structure of the page looks like the following:
Now run the page and see the output here we can identify the difference between Header region and
MessageComponentLayout region:
OAF
OAF
Select region style as rowLayout in the Property Inspector, and if we observe the Property Inspector we have
Horizontal Alignment and Vertical Aligment .
Center, End, Left, Right, Start are the available alignments for Horizontal. By Default , Default is the alignment
type which is nothing but works as Start Alignment.
For Vertical Alignment Bottom, Middle, and Top are the available alignments.
The below picture shows the property inspector of Row Layout Region:
OAF
After creating RowLayout region create four items under the rowLayoutRegion and also give prompt names for
each created items under RowLayout region.
Now run the page and see the output, it displays all the items in single row.
The below figure shows how the output looks like and also observe that in the below figure how the items are
placed in MessgeComponentLayout region and Header Region along with the Row Layout region.
OAF
OAF
OAF
Now after creating Default double Column region create three items under Default Double Column region and
note that all the items the Item Style is messageTextInput and give some prompt name for all the created
items.
After creating items under the default Double Column region the page structure look like the following which
shows Default Double Column region and along with also shows items structure of Message Component Layout
region , Header Region , and Row Layout region.
OAF
OAF
OAF
Here we are taking the page which we created in the previous chapters. After creating the region select the
Region Style as DefaultDoubleColumn, the below figure shows the Property Inspector of Default Double
Column.
OAF
Now create three items under Default Single Column region and also give prompt names to each
MessageTextInput items created:
After creating three items and giving prompt names now run the page and see the output how the items in the
Default Single Column region are displayed.
In the below figure if you observe we can see the difference between other regions along with the Default
Single Column.
OAF
OAF
The items inside Page Button Bar works just like in our mail accounts generally if we open a mail then we can
delete that mail by clicking on Delete button and if we observe in most accounts Delete button is available on
top of the mail and even bottom.
Creating Page Button Bar
First create one page in a project.
Here we are taking the same page which we created early contains five other regions.
Under the main region in a page create one more region and select region style as Page Button Bar.
OAF
After creating region with Region Style as Page Button Bar, create two items under the region and select
Item Style as SubmitButton.
OAF
For one Submit Button item give prompt as Ok and for other give prompt as Cancel.
Now after creating items under the Page Button Bar region, run the page and see the output we can see in the
output items will be displayed on top and bottom of the page. Look at the below figure which shows the look
of output and also it shows how the items in the other region are placed:
OAF
Query Region
In this lesson we are going to see how the Query Region is going to look in OAF page and what is the use of
the Query Region in OAF.
Generally we use Query Region in search pages.
OAF
So therefore we are going to see how to create this Query region in the next coming chapter called Search
Pages in OAF.
We have four types of searches in OAF.
1. Automatic Search Inline LOV
2. Automatic Search External LOV
3. Result Base Search
4. Manual Search
OAF
First create one project and create one page under the main region create one Message Component Layout
region.
Create two Message Text Input items under Message Component Layout Region and give prompt names to
each item.
To make the item required one in the Property Inspector select showRequired and make to True so that the
items become required field.
Now for the item if we want the text in disable mode like the way we usually see while entering Password the
text appears in dots rather than displaying text. In OAF for that feature, select item and in Property Inspector
select Security -> Secret.
By default it sets to False make it True.
OAF
Run the page and see the output, the below figure shows the output which shows the Message Text Input
items what we created:
OAF
First create One Region (Message Component Layout Region) and then now create two items.
Select Item Style as Message Styled Text in Property Inspector (or) if we are using Message Component Layout
region then select New -> MessageStyledText.
Create two items for example and give some prompt name. Run the page and see the output:
: Assigns a default value give this value to Y so that the check box will be checked by default.
Checked Value : This values will be assigned whenever the check box is checked.
Unchecked Value : Value when the item is not checked.
Initially Checked : If we want a value to be checked initially (automatically) then make this value to True.
OAF
The following figure shows the Default Data values for the second check box with prompt name as Check box
two.
Run the page and see the output here we will see other items too in the below figure along with the Check Box
items.
OAF
OAF
Step 2: Now after creating Radio Button items give Id values to each items created and assign Prompt name
which ever you wish to display for the radio button.
Step 3: Set the checked value and unchecked value to each radio button in the Property Inspector.
Step 4: If we want radio buttons to behave as a group then we must programmatically assign them all the
same name by calling setName() for each radio button.
First create one controller and write the program in the processRequest().
Remove one webui from the package name and give controller name and note that every controller ends with
CO (general standard).
Write the program in the processRequest(), here I am not providing any access to the code to copy and paste
it in the JDeveloper because whenever we write the code we need to import the package in the program which
we can get automatically from R12 series on wards.
For example whenever we are typing OAMessageRadioButtonBean then JDeveloper prompts us to use AltEnter to import the required package. So as of now it is better practice to type the code rather than copy and
paste.
We already explained the concept of programming in previous Chapter (Displaying User Name, User ID,
Responsibility Name, Responsibility ID).
OAF
Now after righting the code rebuild the code by giving Right click on the program select option called Rebuild.
After successful compilation of program run the page and see the output, if we test the output radio buttons we
can select any one out of four available items because we set a unique names to all the items in the program
using variable Name . (dot) setName() method. See the code in above picture for confirmation.
The below figure shows output of the program which shows additionally other items too rather than radio
buttons:
OAF
Message Choice
In this lesson we are going to learn how to create Message Choice item in the OAF page.
The bean for message Choice is item is OAMessageChoiceBean.
Step 1: First create Item in the page and select Item Style as MessageChoice in Property Inspector.
Step 2: After creating the page create the VO (View Object) in respective BC4J and attach VO to AM
(Application Module).
Creating VO process:
Right Click on Resources folder of project and then select New View Object as shown in the below figure:
After that a welcome page to create a View Object wizard window will open as shown below:
Click on Next button so that first step to create a VO will come and in that :
Package : Select the proper package name which we created for a project.
Name : give the name to the VO note that all the View objects ends with VO.
OAF
OAF
OAF
Click on Next button without any changes so that we can see the Query area to enter SQL query to retrieve the
data, write the SQL Query in the Query Statement
OAF
After writing the Query statement check whether the written Query is valid or not by clicking on Test so that if
the query is valid then it shows a message that Query is valid. After that click on Next button.
OAF
After creating VO (view object) we need to attach VO to AM (application Module). Let us see how to attach VO
to AM:
Attaching VO to AM:
Edit the AM which we created in the project, right click on AM and then select Edit <AM Name> as shown in the
below figure:
OAF
Select Data Model, extract the package in which VO is created select the VO after selecting the proper VO click
on the Greaterthan arrow symbol which is shown in below figure:
After that we can see the VO is attached to the AM as shown in the below figure:
OAF
Click on Apply button and then on OK button so that the attachment process of VO to AM is over.
OAF
OAF
Now run the page so that we can see the output with drop down list to pick some values. The below image
shows the output of Message Choice along with other items in OAF page.
Note that a drop down list can handle a maximum of 200 values.
Submit Button
In this lesson we are going to see how to create submit button in OAF page.
Here in this lesson we are going to see how to create Submit button Item in Message Component Layout
region, note that we cannot create Submit button directly in Message Component Layout Region for that first
we need to create Message Layout as shown in the below figure:
OAF
After selecting Message Layout item under that Item create one more item as shown in the below figure:
After creating Item under the Message Layout item select the Item Style as submit Button.
Give prompt name to display on top of the button example Ok, run the page and see the output:
OAF
OAF
Image Item
We already seen that how to create a Image in OAF page in previous lesson.
In this lesson we are going to see how to create Item in Message Component Layout region.
Directly we cannot create Image item in Message Component Layout Region, so therefore first we need to
create Message Layout item.
The below figure shows the Image item property Inspector under the Message Layout region:
OAF
In the Image URI give the path of the image which you want to display. Run the page and see the output:
OAF
OAF
Now run the page and just see the output how it looks, the below figure shows the sample output and if we
observe there is no gap between Submit Buttons and Message Text Input Item.
Now to create a space between buttons and items we have one item called spacer. Create two items under
Message Layout and select Item Style as spacer and in Property Inspector give width as 10.
Click on the spacer item hold it and drag it between the Submit Button items, in Message component Layout
region directly we cannot create spacer item so there fore create one message layout hold that item and place
between Message Text Input item and Message Layout Item which is created early.
Now under the second message Layout item create one item with Item Style as spacer and give height as 10
in Property Inspector.
Create the controller under the main region and write the code logic in process Form Request.
if(pageContext.getParameter("item3")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.ERROR);
}
if(pageContext.getParameter("item4")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.CONFIRMATION);
}
if(pageContext.getParameter("item5")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.WARNING);
OAF
OAF
}
}
In the above code item3, item4, item5 are the id values of the Submit Button items with prompt Exception,
Confirm, Warning. Item6 is the id value of Message Text Input item.
The import package is :
import oracle.apps.fnd.framework.OAException;
run the page and see the output. Give some text in Message Input Text and then click on the button to see the
messages displayed on OAF. For example see the following:
OAF
2. Create two items one Message Text Input and other is Message Styled Text with prompts as Enter some
Text : and Entered Text :.
3. Create one button so that when we click on button swapping process to done.
4. Create Controller and write the Swapping logic in ProcessFormRequest.
We already know that how to create a page and how to create a region, the following figure shows the page
structure in JDeveloper:
Now on the main region create Controller and write the logic in Process Form Request, and the code is :
if(pageContext.getParameter("item3")!=null)
{
String name=pageContext.getParameter("item1");
OAMessageStyledTextBean mst=(OAMessageStyledTextBean)webBean.findChildRecursive("item2");
mst.setValue(pageContext,name);
}
}
In the above program item1 is id value of the Message Input Text item, item2 is the Id value of the Message
Styled Text.
Rebuild the code and run the page to see the output.
Enter some text in the field and click on swap button for swapping.
If we want to place or clear the text what we entered then write the following additional code:
if(pageContext.getParameter("item3")!=null)
{
String name=pageContext.getParameter("item1");
OAMessageStyledTextBean mst=(OAMessageStyledTextBean)webBean.findChildRecursive("item2");
mst.setValue(pageContext,name);
OAF
OAF
Follow the steps to display the data in OAF page from the Data Base:
1. Create the page.
2. Create the VO in respective BC4J and attach it to AM.
3. Create the controller and write the logicode in Process Form Request.
To create a VO right Click on the Resources Folder of the project and then select New View Object
To see all the steps that how to create the VO we can see in previous chapter.
After selecting Region Using Wizard then a welcome window will get open as shown below:
OAF
After selecting proper AM we can see the VO attached to that AM in the Available View Usages, which is shown
below:
OAF
Click on Next button, in Step2 window select Region Style as table, the same scenario is shown in the below
figure:
In the next window we will find all the available attributes and in that select the attributes whichever required
to display.
OAF
Click on Next button then we will find a window in that we can change the prompt names if required and also
the style of the item we can change here we are taking all the items as Message Text input types.
OAF
After creating Region Using Wizard now create one more item and the Item Style is Submit Button. So that
the page structure looks like the following:
Now create one controller on the main region. Right click on the region1(Main region id) and then select Set
New Controller
Now after creating the controller write the following code in the process Form Request.
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item1")!=null)
{
OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject vo=(OAViewObject)am.findViewObject("ItemsVO1");
vo.executeQuery();
}
Rebuild the code, run the page and see the output:
OAF
Click on the Go button so that it will display the records as shown below:
OAF
OAF
Now after creating table we need to enter the data into the table for that we know for any kind of DML
operations we need to go for Entity Object in OAF, so now let us create EO on the created table. The following
process shows how to create a EO in OAF.
Creating EO
Right click on the folder Resources which is under the Project in Application Navigator and then select New
Entity Object as shown in the below figure:
OAF
The below figure shows the welcome screen which we will see whenever we click on New Entity Object:
Click on Next Button, whenever we click on next button it shows user name in hide mode and password, no
need to do any changes here because generally we will set project properties, click on ok.
OAF
Click on OK button and then in Entity Object give Name for EO and select the proper Package name, in the
Database Objects select the proper table name:
OAF
Click on Next button so that we can see the attributes available in the Table (attributes are nothing but the
column names of a table which we selected, here all the columns will be converted into attributes).
Click on Next button where in that window we can set all the attributes and in that select the primary key value
if we are not selecting any attribute as primary key the by default it considers ROWID as Primary Key.
No need to do any changes simply click on Next button to see the step5.
OAF
OAF
OAF
Click on Finish button, so that EO will be created, here our EO name is InsertRecordsEO.
Now after creating EO we need to attach this EO to VO.
Create a new VO, and in step2 select the EO under the package, actually in step2 it prompts us to select EO.
The same scenario is shown in the below figure:
Click on Next button to see the step3 and in step3 now we can see all the available attributes of EO.
OAF
In step3 we need to select all the attributes which we want to include, after that click on next button and in
step5 we can see the Query generated, if we want any changes to made in that query then click on Expert
Mode which is unchecked, whenever we click on Expert Mode then the Generated Statement will be highlighted
so that we can modify the query if required:
OAF
Click on Next button and finish the VO creation, and now the EO is attached to VO.
After creating VO and attaching EO to VO now we need to attache this VO to AM for that edit the AM as shown
in the below figure:
OAF
After editing AM extract the proper package name of our project in that we can see the VO select that VO and
then click on > (Greater than symbol) arrow so that VO will be attached to AM, click on Apply button and then
OK button.
OAF
Select the page attach AM to the page and give Window Title and Title in the Property Inspector.
Under the Main region create One Message Component layout region create five Message Text Input Items and
one Submit Button, and one more reset Button.
Give Prompt names to all the items which are created accordingly, like :
item1 (Message Text Input item)
item2 (Message Text Input item)
item3 (Message Text Input item)
item4 (Message Text Input item)
item5 (Message Text Input item)
item6 ( Submit Button)
item7 (Reset Button)
After creating items now the page structure looks like the following:
OAF
Select each Item and then for each Message Text Input Items select View Instance and View Attribute. The
following pictures shows the selection process for one item.
Note that Data Type and Maximum length must be mapped properly to each item.
Selecting View Instance for an item click on view instance then click on the icon
following window will get opens and then in that select the View Instance.
so that the
after selecting View Instance select View Attribute and then click on the icon
will get opens and in that select the proper attribute.
OAF
Now select the AM java program, the scenario is shown in the below picture:
OAF
OAF
Now create one new method in the AMImpl class, here the method name is InsertRecord, write the
following code in the AMImpl class :
OAF
vo.insertRow(v_row);
}
In process request of Controller initialize the AM the following code shows the initialization process of AM in
controller.
InsertRecordsAMImpl am=(InsertRecordsAMImpl)pageContext.getApplicationModule(webBean);
am.InsertRecord(); /* Name of the method which we created in AM */
}
In the Process Form Request now we need to write the code for the item Save or Add prompt button so that
whenever we click on that button the data will be added into the table.
InsertRecordsAMImpl am=(InsertRecordsAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("item6")!=null)
{
am.getOADBTransaction().commit();
throw new OAException("Employee Created sucsessfully",OAException.CONFIRMATION);
}
}
Now rebuild the code in AM and in Controller and run the page to see the output. Enter the data and click on
Add button to save the entered data into the table.
OAF
OAF
We know that to display data we need to create VO, attach VO to AM and then we need to execute the VO
query whenever we click on the button, so there fore for that we need to write the code in the Process Form
Request of Controller.
To know how to display data from the data base see the chapter called Displaying Data from DataBase.
Let us see the parameter list in pageContext.setForwardURL.
example code is :
null,
line3 :
menu_context,
line4 :
null,
line5 :
params(null),
line6 :
RetainAM(true),
line7 :
ADD_Bread_Crumbs,
line8 :
Ignore_Messages);
In this chapter we used displaying data of employees information which are entered in Data Entry page of
previous lesson, if we want to see the employees information then we need to click on the button Get
Employee Information and to create a new employee we need to click on Create Employee button.
The page structure of the Project what we are using now contains one main region and under it One Table
Using Wizard Region, two submit buttons. The following figure shows the page structure:
If we run the page after creating VO and executing that VO whenever we click on the Get Employee
Information then the output looks like the following:
OAF
OAF
If we observe in the output whenever we click on the Create Employee button it must take us to the Create
Employee page which we created and seen in previous lesson.
Whenever we click on the Create Employee button then only it must take us to the Create Employee page so
for that we need to write the code in the processFormRequest of controller and the code in
processFormRequest is:
if(pageContext.getParameter("item3")!=null)
{
pageContext.setForwardURL("OA.jsp?page=/xxapples/oracle/apps/po/insertingrecords/webui/InsertDataPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
In the program item3 is the id value of the Create Employee button. When we rebuild the code and run the
page then the output looks like the following:
OAF
Now after clicking on the Create Employee button it leads us to Create Employee page:
SPEL In OAF
SPEL stands for Simplest Possible Expression Language.
SPEL is used to carry the values dynamically. SPEL will get the value dynamically at runtime. SPEL is the
Boolean Value (True / False). The syntax of SPEL is:
OAF
Now let us see the previous chapter output which shows the Employee Information when we click on Get
Employee Information button now the same output we are adding one image icon so that it appears to each
and every row as shown in the below figure:
OAF
Now we will see the process how to add edit image for each row in a table. For that first we need a page
structure as follows:
OAF
In the above page structure we created a region Using Wizard and the region style is Table. Item1 is the
submit button whenever we click on the Submit Button(Get Employee Information) it displays the employee
information as shown in the below figure:
Now go to the table region, right click on the table region select New -> Item.
In the Property Inspector of item do the following changes:
1. Select the Item style as image.
2. In Image URI give the name of the image for example for edit image we have predefined images in
p9879989_R12_GENERIC\jdevhome\jdev\myhtml\OA_MEDIA , give the following image in Image
URI /OA_MEDIA/detailsicon_enabled.gif.
3. In client action select Action Type as fireAction.
4. In client action give Event name as Edit
Now the page structure looks like:
OAF
Now run the page and click on the button Get Employee Information so that the output looks like the above
picture what we have seen early.
Now whenever we click on the image item then it must show us the information in different form, for that we
need to write the following code in processFormsRequest of controller:
if("Edit".equals(pageContext.getParameter(EVENT_PARAM)))
{
pageContext.setForwardURL("OA.jsp?page=/xxapples/oracle/apps/po/insertingrecords/webui/InsertDataPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
OAF
in IF condition Edit is the Client Action Event Name which we have given. The remaining code logic is same
which we used in previous chapter takes us to create employee page but here we need to carry the data to
that page rather than creating employee.
To achieve these requirement we need to create a spell, keep continue reading so that we will come to know
how to create a SPELL in OAF.
SPEL creation in OAF, we know the syntax of SPEL now we need to create a SPEL for the image item in a table.
The SPEL value for the above is as follows:
${oa.EmployeeSearchVO1.Empno}
EmployeeSearchVO1 is the name of the VO which is used to get the details of employees.
Empno is the primary key value (attribute name)/ column name of the table in view.
Now we need to pass the above spel to image, for that select the image and then in Property Inspector,
Client Action -> Parameters
Once we click on the icon a Parameters window will get open in that, click on Add Parameters button and then
give some name (example pempno) in the value pass the SPEL what we created
( ${oa.EmployeeSearchVO1.Empno} ). After giving name and passing SPEL value in the Value field click
on OK button.
OAF
Now we need to call this parameter in the Create Employee page CO because whenever we click on the image
item in the table list showing employee details it takes us to the Create Employee Page but it will not carry any
values here our task is to carry values.
So therefore we need to write the code in processRequest of the controller class of Insert Employee details
page. The code is as follows:
BharathAMImpl am=(BharathAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("pempno")!=null)
{
String hid = pageContext.getParameter("pempno").toString();
String whereclause = "EMPNO='"+hid+"'";
am.getEmployeeCreateVO1().setWhereClause(null);
am.getEmployeeCreateVO1().setWhereClause(whereclause);
am.getEmployeeCreateVO1().executeQuery();
}
else
{
am.InsertEmployeeRecord();
}
}
Now rebuild the code, rebuild the pages run the Employee Information Page, click on the Get Employee
Information button and then click on the image item which is displayed on each available rows so that it takes
us to create employee page but here it carries the row values. The sample output is shown in the below figure:
OAF
Automatic Search
Result Base Search
Manual Search
Automatic Search is again divided into two types:
1. Inline LOV
2. External LOV
Automatic Search and Result Base Search will take care by the Query Region where as for Manual Search we
have to write the condition manually.
We will see in the coming chapters how to create the search pages in Oracle Apps Framework.
In this lesson we will see how to create Inline LOV search page.
Inline LOV is used to search with in the page.
The following are the steps to create Inline LOV
Step1: Create the new WorkSpace and project, create new page add AM to the page.
Step2: Create new VO in respective BC4J. While creating VO change the package name of BC4J to
.lov.server at end, generally List of Values VO ends with LOVVO and the example BC4J path is:
Step3: Under the main page create new item and select item style in property Inspector as
MessageLOVInput.
We can find List of Values region under Message LOV Input item.
Right click on the List of Values region select New -> Table Using Wizard
OAF
OAF
Here we can create Table Style region only we cannot change the region style to another one.
See the below image it shows that how the page structure will look now:
Select the FirstName item under the table region and then in the property Inspector of that item check that in
the Functional, Search Allowed is set to True.
Step4: Select LOV Mappings in the structure of Message LOV input after that do the following changes in the
property inspector of lovMap1.
Functional:
LOV Region Item : FirstName (the item to display in the LOV region)
Return Item : item1 (the item to return)
Criteria Item : item1 (criteria item works like in where condition value)
Run the page and see the output. The first page of the output looks like the following:
OAF
OAF
Check the Radio Button of which employee you want to choose and then click on Select button or use Quick
Select option to select the name which is required.
After choosing the name it will display in the Message Text Input item as follows:
OAF
OAF
After selecting new option we will see a gallery window in that extract web tier in categories select OA
Components and then select Region in items list.
After selecting region click on ok button so that a window will get open in that
Name : Give any user defined name
Package: Select the proper package of the project.
Style : select style as List of values.
OAF
OAF
OAF
Step6: Under the Message LOV input region create on table region using wizard. In the table region select the
proper package name and then as we attached our VO to the AM it will display our LOVVO so select that VO
and therefore a table region will be created with one item under it.
Step7: Select the Message LOV input item and in the Property Inspector of Message LOV input select External
LOV as shown in the below figure:
OAF
OAF
Click on the Browse button and then select the proper package name for example see the below picture:
OAF
Click on the search button and then select the fully qualified name in the search results for example see the
below picture:
OAF
Click on OK button so that JDeveloper asks for confirmation in that click on OK button.
Step8: Run the page and see the output. The following three images shows the output and its work process
OAF
Select any value whichever you want to select. Use Quick select or radio button process:
OAF
OAF
Step1: Create Workspace, project , AM and create one page assign AM to the page give page title and window
title.
For example :workspace name : ResultBaseSearch
Project Name : ResultbasesearchPRJ
package name : xxresultbasesearch.oracle.apps.po.resultbasesearchprj.webui
AM name : ResultbasesearchAM
AM Package name: xxresultbasesearch.oracle.apps.po.resultbasesearchprj.server
Step2: Create new VO in respective BC4J, generally List of Values ends with VO and the example BC4J path is:
Package (BC4J) : xxresultbasesearch.oracle.apps.po.inlineprj.server
VO name : ResultBaseSearchVO
Query in the VO is:
SELECT PERSON_ID,
OAF
FULL_NAME,
DATE_OF_BIRTH,
KNOWN_AS,
NATIONALITY
FROM PER_ALL_PEOPLE_F
After creating Query Region in main region select the Query Region property Inspector and in Property
Inspector select Construction Mode as Result Base search as shown in the below figure:
OAF
Now in the page structure select the Query region, right click on the Query region select New -> Region
Using Wizard
Select Proper Application Module in the first step of creating region as show in the below figure:
In step2 select the region style as Table as show in the below image:
In step3 select the attributes of VO which you want to display in the output.
OAF
OAF
OAF
Click on GO button to see the resultant output as shown in the below picture:
Manual Search
In this lesson we are going to see how to create manual search page in OAF manually. Manual Search page we
need to enter the data value to search for example employee names starting with A then we used to type A%
in oracle apps forms similarly in OAF the manual search page will work like.
Step 1: Create Workspace, project , AM and create one page assign AM to the page give page title and window
title.
For example :
workspace name : ManualSearch
Project Name : ManualSearchPRJ
OAF
Now if we observe the above image we need to create three Message Text Input items for search and two
button items.
After entering data in Message Text Input items and once we click on Go button then according to the search
item provided the resultant values must be displayed in the below table region.
steps to construct the page like above picture:
OAF
Step 4:- Now open the java file of AM and create one method in AM and write the logic.
OAF
OAF
Step 5:- Create the controller and write the logic for buttons in Process Form Request of controller and here is
the logic.
ManualsearchAMImpl am=(ManualsearchAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("item4")!=null)
{
am.xxSearchParams(pageContext,webBean);
}
if(pageContext.getParameter("item6")!=null)
{
OAMessageTextInputBean msb = (OAMessageTextInputBean)webBean.findChildRecursive("item1");
msb.setValue(pageContext,null);
OAMessageTextInputBean msb2 = (OAMessageTextInputBean)webBean.findChildRecursive("item2");
msb.setValue(pageContext,null);
OAMessageTextInputBean msb3 = (OAMessageTextInputBean)webBean.findChildRecursive("item3");
msb.setValue(pageContext,null);
}
}
Step 6:- Now after writing logic in AM and Controller rebuild the code and run the page to see the output.
The resultant page may look like the following figure:
Give some text in any Text input field and click on go button.
OAF
OAF
Project Requirement
1. Every patient who is coming to clinic for checkup we need to create one OAF page through which we will
enter the details of the patient.
2. We need to create another page which shows the details of the patients it means this page is just a search
page.
3. One more page is for updating the patient entered details.
OAF
The following image shows the sample design format according to that we need to design our OAF Page
We guess every field what is there in the design page we know all are patient Details.
Only one field Review is what we need to know here, for every patient who come for initial checkup for him the
next two visits with in 10 days is free of cost and first time the patient is considered as new entry. So there
fore for the first time Review Entry is New.
If the patient is going to visit the clinic next time within 10 days then the patient details entered with separate
patient id but in place of Review rather than the new it will be entered as Review1 or Review2 (Rev1 or Rev2).
After entering the patient details the first and main page will be searching the patient details the below picture
shows the search page design format.
OAF
OAF
Now according to the document that is based on MD-050 document we need to create the page structure of
Patient Entry page. The below figure shows the page structure with description of each item and regions.
OAF
Run the page and see the output, the below picture shows the output of the page.
Now for every value what we are entering in the field must be saved in the data base and for that we know
that we need to insert data into the table.
Create one table which stores the details of patients in Data Base. The Table with who columns is :
PATIENT_NAME VARCHAR2(40),
REVIEW VARCHAR2(10),
PHONE_NUMBER NUMBER(15),
SEX VARCHAR2(7),
AGE NUMBER(3),
OAF
AMOUNT NUMBER(6),
DATE_CHECKED DATE,
ADDRESS VARCHAR2(40),
--who columns
LAST_UPDATE_LOGIN NUMBER);
Now after creating table we need to create one Entity Object in the project.
Create one Entity Object (EO) in the project
For example:
Entity Name : StirlingPatientEntryEO
Package : xxstirling.oracle.apps.po.stirlingprj.schema.server
After creating Entity Object Create one VO, for example:
View Object Name: PatientEntryVO
Package: xxstirling.oracle.apps.po.stirlingprj.server
Attach EO to VO while creating.
Attach VO to the AM.
After attaching VO to the AM give View Instance and View attribute to each and every item in the page and
check the data type and size of the attribute is mapped properly. We have seen the radio buttons so for both
Radio Button items give the same View Instance and View Attribute and Checked value for Male is MALE,
checked value for Female is FEMALE.
Radio Button validation in a page:
For Radio buttons only one radio button must be checked out of all available radio buttons for that we need to
write the code in the Process Request of the controller.
OAF
Create one Controller on the main region and write the following Radio Button Validation code in the Process
Request of Controller:
StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean);
am.xxinsertpatient();
After initializing AM and the method of AM in controller, we have to write the validation code for Add button so
therefore we need to write the code in ProcessFormRequest for Add button as follows:
StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean);
OAF
if (pageContext.getParameter("item3")!=null)
am.getOADBTransaction().commit();
}
Now rebuild the code in the controller and also rebuild the code in the AM. After successfully rebuilding the
code run the page enter some date and click on Add button so that patient will be added.
OAF
For example:
OAF
The below figure shows the page structure of the Search Page, which contains 3 message Text Input items for
searching and down one table layout region.
Here the search result will be displayed in table format so here we are adding images for update and detail of
the resultant rows in OAF page. The below picture shows the page structure of the search page:
OAF
The below figure shows the page structure output of the Search Page:
Still now we just created the page structure but the page is not yet validated properly.
After creating page structure we need to create the Method in AM for search operation, it means if we are
entering patient Id then in the where condition SQL Query must filter the Rows according to the entered Patient
Id related similarly for Patient Name and Patient Phone Number too.
So therefore we need to write a SQL data retrieval Query, create one VO and write the Query in the VO Qeury
area:
VO Name: SearchVO
OAF
After Creating VO attach VO to the AM. After attaching create method in AM, the following code shows the java
code of creating Method in AM.
if (pc.getParameter("item1")!=null)
{
pid = pc.getParameter("item1").toString();
vo1.setWhereClauseParam(0,pid);
}
else
{
vo1.setWhereClauseParam(0,null);
}
if(pc.getParameter("item2")!=null)
{
name = pc.getParameter("item2").toString();
OAF
vo1.setWhereClauseParam(1,name);
}
else
{
vo1.setWhereClauseParam(1,null);
}
if(pc.getParameter("item3")!=null)
{
phno = pc.getParameter("item3").toString();
vo1.setWhereClauseParam(2,phno);
}
else
{
vo1.setWhereClauseParam(2,null);
}
vo1.executeQuery();
}
Create One controller in Search page and initialize the AM in the SearchPage Controller, note that we already
initialized AM in Patient Entry page Controller. Now we are initializing AM in SearchPage Controller, initialize the
AM in ProcessRequest as follows:
if(pageContext.getParameter("item4")!=null)
{
OAF
am.xxSearchPatient(pageContext,webBean);
}
else
if(pageContext.getParameter("item6")!=null)
{
OAMessageTextInputBean mstb = (OAMessageTextInputBean)webBean.findChildRecursive("item1");
mstb.setValue(pageContext,null);
OAMessageTextInputBean mstb1 = (OAMessageTextInputBean)webBean.findChildRecursive("item2");
mstb1.setValue(pageContext,null);
OAMessageTextInputBean mstb2 = (OAMessageTextInputBean)webBean.findChildRecursive("item3");
mstb2.setValue(pageContext,null);
}
else
if(pageContext.getParameter("item8")!=null)
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StrilingPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
Rebuild the code and run the page the below image shows the search page with results after clicking on Search
Button:
OAF
If we observe in the output we created two image items one is for Update and Other is for Details of the
patients. We not yet validated the Edit and Update images.
The next lesson shows how to create Update page and the page structure of the Update page and output of
Update, but for Update the values must be carried so hence we know that to carry values we will create SPEL
in OAF.
The update must contain the same details what we are entering while creating or adding patient, so there fore
the same page structure is required for us.
OAF
After Copying the page structure we can see that same page structure is copied into the new update page
structure so that we can save some time rather than creating each item and changing the view instance and
view attribute and prompt names etc.,
If we observe we not yet created Update Button and after updating Patient details we need to go back to the
other main page, so for that another button need to be created.
Create two submit buttons with some space between the buttons looks good rather than placing them in
conjunction. So create one spacer item between region and one more spacer item between two submit buttons.
OAF
Finally the Update page structure looks like the following image:
Run the page to see the output and for the new created page also we need to attach corporate branding image.
The update page contains the details which are already entered so we just need to edit only few values or we
need to change only one or two changes like name is spelled wrong, amount entered is not correct or might be
refunded to the patient, etc.,
So therefore whenever on search page if we click on Update Image then it must take us to this update page
along with the details and after making changes we need to update the same row.
First let us write the code to validate the Update button and other button in the page.
Create the Controller in Update Page region, initialize the AM in the process Request of the controller:
OAF
StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean);
am.xxinsertpatient();
Write the following code in processFormRequest, if you observe the code is similar code for update too like the
way we wrote for patient entry.
if (pageContext.getParameter("update")!=null)
{
am.getOADBTransaction().commit();
throw new OAException("Patient Data Updated Successfully",OAException.CONFIRMATION);
}
if(pageContext.getParameter("item4")!=null)
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StrilingPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
The below image shows the output of Update page.
OAF
and another is for seeing the details and the image icon is
OAF
Now we need to validate the image items in the result and whenever we click on these image items it must
take us to another page along with carrying the values too, so therefore we need to create SPEL for each image
item and then we have to write the code in processFormRequest of search page controller.
SPEL value of Update icon: ${oa.SearchVO1.PatientId}
Parameter Name of Update Icon: pid
SPEL value of Detail Icon: ${oa.SearchVO1.PatientId}
Parameter Name of Detail icon: ppatientid
Write the following code in ProcessFormRequest of search page controller, continuing the previous code
.....................
.....................
}
else
if("update".equals(pageContext.getParameter(EVENT_PARAM)))
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StirlingUpdatePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
else
if("detail".equals(pageContext.getParameter(EVENT_PARAM)))
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StrilingPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
Now the entire code in the controller class of Search page looks like the following:
if(pageContext.getParameter("item4")!=null)
{
am.xxSearchPatient(pageContext,webBean);
}
else
if(pageContext.getParameter("item6")!=null)
{
OAMessageTextInputBean mstb = (OAMessageTextInputBean)webBean.findChildRecursive("item1");
mstb.setValue(pageContext,null);
OAMessageTextInputBean mstb1 = (OAMessageTextInputBean)webBean.findChildRecursive("item2");
mstb1.setValue(pageContext,null);
OAMessageTextInputBean mstb2 = (OAMessageTextInputBean)webBean.findChildRecursive("item3");
mstb2.setValue(pageContext,null);
}
else
OAF
OAF
if(pageContext.getParameter("item8")!=null)
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StrilingPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
else
if("update".equals(pageContext.getParameter(EVENT_PARAM)))
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StirlingUpdatePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
else
if("detail".equals(pageContext.getParameter(EVENT_PARAM)))
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StrilingPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
OAF
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean);
//am.xxinsertpatient();
if(pageContext.getParameter("pid")!=null)
{
String pid = pageContext.getParameter("pid").toString();
String whereclause = "PATIENT_ID='"+pid+"'";
am.getPatientEntryVO1().setWhereClause(null);
am.getPatientEntryVO1().setWhereClause(whereclause);
am.getPatientEntryVO1().executeQuery();
}
else
{
OAF
am.xxinsertpatient();
}
OAMessageRadioButtonBean var1 = (OAMessageRadioButtonBean)webBean.findChildRecursive("male");
var1.setName("Gender");
var1.setValue("Male");
/**
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item4")!=null)
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StrilingPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
}
The above code is the Controller class code in Update Page.
StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean);
if(pageContext.getParameter("ppatientid")!=null)
{
String pid = pageContext.getParameter("ppatientid").toString();
String whereclause = "PATIENT_ID='"+pid+"'";
am.getPatientEntryVO1().setWhereClause(null);
am.getPatientEntryVO1().setWhereClause(whereclause);
am.getPatientEntryVO1().executeQuery();
}
else
{
am.xxinsertpatient();
OAF
OAF
/**
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
StirlingAMImpl am = (StirlingAMImpl)pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("item3")!=null)
{
System.out.println("Add button called");
am.getOADBTransaction().commit();
throw new OAException("Patient Data Entered Successfully",OAException.CONFIRMATION);
}
if(pageContext.getParameter("item9")!=null)
OAF
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/SearchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
else
if (pageContext.getParameter("item11")!=null)
{
pageContext.setForwardURL("OA.jsp?page=/xxstirling/oracle/apps/po/stirlingprj/webui/StrilingPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
}
The code below is the code is the AM Java code, and note that we created only one AM for the entire project.
We created two methods overall in AM and the below code shows the two methods:
vo.executeQuery();
Row v_row = (Row)vo.createRow();
vo.insertRow(v_row);
}
OAF
OAF
{
phno = pc.getParameter("item3").toString();
vo1.setWhereClauseParam(2,phno);
}
else
{
vo1.setWhereClauseParam(2,null);
}
vo1.executeQuery();
}
Transient attribute in OAF is nothing but the attribute value which is not in the Oracle Data Base table. We
know that while creating VO all the Columns of table will be converted into Attributes or we call columns as
attributes in VO, so therefore transient attribute is one which we create temporarily to display some results
which will not effect data base tables.
For example Student marks are saved in different columns but in data base assume that we are not
maintaining any column for total marks sum but if we want the total value to be displayed in OAF form so
therefore for that we will create on temporary or duplicate attribute value to hold total marks.
Let us see how to create transient attribute in OAF according to our requirement:
Right click on VO and select Edit PatientEntryVO or double click on the VO to open it.
After opening the VO select the Attributes value in left side as shown in the below figure:
OAF
OAF
Select New button which is located down to the attributes list, After selecting New button give new attribute
name, Type as Boolean, and in Updatable select a Radio Button option called Always, for example see the
below picture:
OAF
Click on Ok button later click on Apply and Ok button in View Object so that the transient attribute will be
created.
After creating transient attribute now create one SPEL value basing on patient entry vo, because we need to do
dynamic changes in this page only:
${oa.PatientEntryVO1.xxReadOnly}
After creating SPEL pass this SPEL value in each and every item of a Patient Entry page region, pass the SPEL
value to all the items those we want them to act as a read only values, note that we cannot pass this SPEL
value directly to region because of that reason we have to pass in each item, now the question rises where to
pass SPEL value:
Pass the SPEL value in :
-> Select XML page and in page structure select the item.
-> In the property inspector Functional -> Read Only, here we will find True and False.
-> Remove the current existing True/False value and place the SPEL value which we created here.
pass the SPEL values to all the items and even to ADD button item.
After adding the SPEL value go to AM and add the following additional line in the AM method which we created
to add patient as follows:
OAF
v_row.setAttribute("xxReadOnly",Boolean.FALSE);
}
In the Controller class add the following code, in code ppatientid is the parameter value of detail icon which
we already seen in the previous lessons so additionally we are adding three lines which are:
if(pageContext.getParameter("ppatientid")!=null)
{
String pid = pageContext.getParameter("ppatientid").toString();
String whereclause = "PATIENT_ID='"+pid+"'";
am.getPatientEntryVO1().setWhereClause(null);
am.getPatientEntryVO1().setWhereClause(whereclause);
am.getPatientEntryVO1().executeQuery();
Rebuild the code and run the page and see the output, the below figure shows the search page output and the
second image shows the dynamically changed page which is actually the patient entry page:
OAF
OAF
OAF
JAVAC <Java_file_name.java>
If we are moving Class files then the compilation is not required, i.e., instead of compilation we can move class
files directly.
Note: The best approach is to move java files into server and compile, so that server side compatibility will be
there.
In linux environment to know where exactly the JAVA_TOP is located type the following command in putty:
cd $JAVA_TOP
after changing the directory type the following command so that we will come to know the path location where
exactly the JAVA_TOP is located:
pwd (Present working Directory)
example:
/u01/apps1/apps/apps_st/comn/java/classes
Step 2: After finding where exactly the Java top is located move the files into java top, let us see how to move
class files, here we are moving class files to the JAVA_TOP using the WinScp
The below image shows the moving process in WinScp
Drag the folder from left side and drop it on the linux/unix environment:
OAF
Select the folder drag and drop it to the server environment, after that one popup window will come and click
on Copy button:
In the next lesson we are going to see Import script, and why we need import script.
OAF
so for the above search page see the following import script which we need to perform in putty:
java oracle.jrad.tools.xml.importer.XMLImporter
$JAVA_TOP/xxstirling/oracle/apps/po/stirlingprj/webui/SearchPG.xml -username apps -password apps -dbconnection
"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=www.newtonapples.com)(PORT=1521
)))(CONNECT_DATA=(SERVICE_NAME=vis)))" -rootdir $JAVA_TOP
the above import script is for linux/unix environment but few students might practice in Windows server
environment for them the following is the import script for window server environment:
import
D:\Bharath\Softwares\p9879989_R12_GENERIC\jdevhome\jdev\myprojects\xxstirling\oracle\apps\po\stirlingprj\webui\
SearchPG.xml -rootdir ...(your win server apps rootdir)..\jdevhome\jdev\myprojects -username apps -password apps dbconnection
"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=www.newtonapples.com)(PORT=1521
)))(CONNECT_DATA=(SERVICE_NAME=vis)))"
For each and every page we need to execute the import script in OAF, the below image shows import script
execution process i.e., after writing the import script the following is the confirmation it shows in putty:
Whenever the import script is executed successfully i.e., if the importing file is properly executed then it shows
a message called Import Completed.
OAF
In the next lesson we are going to see how to create function, creating menu, and attaching menu to
Responsibility.
OAF
After selection, then a Function window will get opens, give the Function Name and User Function Name
After that go to Properties tab and in that give Type as SSWA jsp function
OAF
OAF
After that go to Web Html tab and in that in HTML call give the address bar generated page path dont give
.xml extension.
OAF
Give Menu name and function Name, if we want to create Submenus then create one more menu add function
to that and design the menu structure according to the Oracle Applications guidance.
OAF
After that create one responsibility (optional) add menu to that responsibility, the below image shows the
responsibility navigation in System Administrator:
Give the values in Responsibility, for example see the below image:
OAF
OAF
After adding menu to the responsibility attach Responsibility to the User, Bounce the Server.
Clear the Cache using Functional Administrator which is Optional.
The below image shows the example navigation of the Responsibility which contains two sub menus under one
main menu.
OAF