Oracle ADF Training Hands-On Lab Practices - Student
Oracle ADF Training Hands-On Lab Practices - Student
Table of Contents
1 Overview of Fusion Middleware and ADF ..............................................................1
1.1 System Requirements for ADF Training -* ......................................................2
1.2 Oracle Technology Resource Account Login -* ................................................3
1.3 Downloading and Installing Oracle XE Database -* .........................................4
1.4 Downloading and Installing JDeveloper -* ......................................................5
1.5 Unlocking HR Schema -* ...............................................................................9
1.6 Entity Relation Diagram of HR System -*...................................................... 11
1.7 Working with JDev IDE Configuration Files -o ............................................... 13
1.8 Java for Beginners -o .................................................................................. 14
1.9 References -o ............................................................................................. 15
1.10 Grouping of Hands-on Lab Practices -* ........................................................ 16
1.11 Important Abbreviation and Information -* .................................................. 17
1.12 Downloading Training Materials -* ............................................................... 18
1.13 Important to go through after the training -o ............................................... 19
2 Understanding Development Tool: JDeveloper .................................................... 20
2.1 Creating a New Fusion Application and Project -* ......................................... 21
2.2 Creating a New Database Connection and Initialize the Project -* .................. 25
2.3 Adding ADF Business Components and ADF Faces -* .................................... 27
2.4 Exploring JDeveloper and New Application -* ............................................... 33
2.5 Exploring Windows of JDeveloper -* ............................................................ 34
2.6 Working with Windows -*............................................................................ 35
2.7 Taking Help using F1 key -* ........................................................................ 36
2.8 Refactoring JDeveloper Artifacts -* .............................................................. 37
2.9 Setting IDE Preferences -* .......................................................................... 39
2.10 Setting Package Levels -* ............................................................................ 41
2.11 Lab Solution ............................................................................................... 42
3 Modeling Database Schema ............................................................................... 43
3.1 Copying Application -o ................................................................................ 44
i
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
ii
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
iii
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
iv
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
v
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
vi
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
vii
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
viii
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
ix
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
x
ADF Essentials Training by Deepak Bhagat
Develop Rich Web Application with ADF 12c Essentials – Hands-on Lab Practices
1
Overview of Fusion Middleware
and ADF
For detail information refer handout “…\BATHandouts\BATDocs-
PreTrainingMaterial\BAT ADF Hands-on Lab Setup Guide.pdf”.
Download all Oracle ADF training documents and lab solutions, from shared folders on Google
GDrive shared by the trainer. Unzip all lab solutions. These training materials consist of study
guides, hands-on lab practices, reference guides, bookmarks, downloaded materials, extended
samples, demos, books, tutorials, etc.
1/465
ADF Essentials Training by Deepak Bhagat
1.1 System Requirements for ADF Training -*
2/454
ADF Essentials Training by Deepak Bhagat
1.2 Oracle Technology Resource Account Login -*
Login to your Oracle Resource account. Create one if necessary. The URL is
https://www.oracle.com/technical-resources -> View Accounts -> Oracle Account -> Sign-In.
3/454
ADF Essentials Training by Deepak Bhagat
1.3 Downloading and Installing Oracle XE Database -*
4/454
ADF Essentials Training by Deepak Bhagat
1.4 Downloading and Installing JDeveloper -*
5/454
ADF Essentials Training by Deepak Bhagat
12) Oracle JDeveloper Studio Settings wizard appears.
a) In the Default User Directory field, enter D:\<<User>>\.jdeveloper.
b) In the JDeveloper Work Directory field, enter D:\<<User>>\BATJDev122100.
Click OK.
D:\Deepak-PC\.jdeveloper
D:\Deepak-PC\BATJDev122100
6/454
ADF Essentials Training by Deepak Bhagat
15) To start JDeveloper, click on the Start menu > Oracle > Oracle JDeveloper Studio,
or double-click on the desktop shortcut .
7/454
ADF Essentials Training by Deepak Bhagat
8/454
ADF Essentials Training by Deepak Bhagat
1.5 Unlocking HR Schema -*
1) After Installing Oracle XE, you can access ‘system’ schema but not ‘hr’ schema. ‘hr’ schema
comes along with Oracle XE database, but locked. To unlock ‘hr’ schema from database to
grant permission to the users to utilize this schema, follow below steps.
a) Click Start > expand Oracle Database 11g Express Edition > select Run SQL
Command Line.
9/454
ADF Essentials Training by Deepak Bhagat
c) Within the dialog, simply uncheck the box entitled Account is Locked and
click Apply.
d) After completing this process, you should now have a fully functional Oracle XE
database with the example HR schema unlocked.
10/454
ADF Essentials Training by Deepak Bhagat
1.6 Entity Relation Diagram of HR System -*
11/454
ADF Essentials Training by Deepak Bhagat
12/454
ADF Essentials Training by Deepak Bhagat
1.7 Working with JDev IDE Configuration Files -o
1) The locations from where you can start JDeveloper apart from the shortcuts are:
a) MW_HOME\jdeveloper\jdeveloper.exe
b) MW_HOME\jdeveloper\jdev\bin\jdevw.exe
c) MW_HOME\jdeveloper\jdev\bin\jdev.exe
The first two options have the same purpose. The last option will open along with a console
for diagnostic purposes. Example of MW_HOME is C:\Oracle\Middleware122100.
2) An alternate way for this is to set the JDEV_USER_DIR environment variable that points
to the user's current working directory.
JDEV_USER_HOME and JDEV_USER_DIR are the variables that are listed in the
MW_HOME\jdeveloper\jdev\bin\jdev.boot file. JDeveloper will look up these variables on
startup to set the user's directory. For example:
set JDEV_USER_HOME=C:\Users\<<User>>\AppData\Roaming\JDeveloper
set JDEV_USER_DIR=D:\<<User>>\BATJDev122100\mywork
3) Location of IDE configuration files:
a) MW_HOME\jdeveloper\ide\bin\ide.conf
b) MW_HOME\jdeveloper\jdev\bin\jdev.conf
4) Location of IDE boot files:
a) MW_HOME\jdeveloper\ide\bin\ide.boot
b) MW_HOME\jdeveloper\jdev\bin\jdev.boot
13/454
ADF Essentials Training by Deepak Bhagat
1.8 Java for Beginners -o
Following links are limited Java necessary for ADF. Those moving to ADF from non-Java
background may find these sufficient to learn Java.
1) http://www.javatpoint.com/simple-program-of-java
2) http://www.javatpoint.com/variable-datatype
3) http://www.javatpoint.com/operators-in-java
4) http://www.javatpoint.com/object-and-class-in-java
5) http://www.javatpoint.com/constructor
6) http://www.javatpoint.com/static-keyword-in-java
7) http://www.javatpoint.com/this-keyword
8) http://www.javatpoint.com/interface-in-java
9) http://www.javatpoint.com/access-modifiers
10) http://www.javatpoint.com/package
14/454
ADF Essentials Training by Deepak Bhagat
1.9 References -o
15/454
ADF Essentials Training by Deepak Bhagat
1.10 Grouping of Hands-on Lab Practices -*
16/454
ADF Essentials Training by Deepak Bhagat
1.11 Important Abbreviation and Information -*
Important Information:
1) The labs marked with –o, -x and –d are extended example(s), as Advance ADF topics for
optional self-paced Hands-on practice.
2) Some images may have the word AAT instead of BAT and aat instead of bat. Please
read/replace them as BAT and bat respectively.
3) Steps provided for Hands-on Labs are beta version and not fully verified yet. All errors and
omissions are regretted.
4) Kindly contribute with corrections to the Hands-on Lab Practices, to help the ADF
community, as all Oracle ADF documents written by us, are free with no copyright. To
participate send an email to [email protected].
5) Do share freely with larger ADF communities.
17/454
ADF Essentials Training by Deepak Bhagat
1.12 Downloading Training Materials -*
Download all Oracle ADF training documents and lab solutions (prepared by Deepak Bhagat),
from shared folders on Google GDrive. Unzip all lab solutions. These training materials consist of
study guides, hands-on lab practices, reference guides, bookmarks, downloaded materials,
extended samples, demos, etc. Hands-on Lab Practices is a beta version.
You may also find some Advance ADF topic examples in Deepak Bhagat’s blog at
https://cloudadfdeepakb.blogspot.com.
18/454
ADF Essentials Training by Deepak Bhagat
1.13 Important to go through after the training -o
Documents:
10) ...\BATHandouts\BATDocs-PreTrainingMaterial\Print- BAT ADF Handy Reference.pdf
11) ...\BATHandouts\BATDocs-TrainingMaterial\BAT ADF Study Guide - student.pdf
12) ...\BATHandouts\BATDocs-TrainingReference\BAT ADF Assorted Notes.pdf
13) ...\BATHandouts\BATDocs-TrainingReference\L08-BAT Introduction to Groovy.pdf
14) ...\BATHandouts\BATDocs-TrainingReference\Oracle ADF Bookmarks 2016.html
15) ...\BATHandouts\BATDocs-TrainingReference\Oracle ADF Feeds Firefox 2015.opml
16) ...\BATHandouts\OADFDocs-Downloaded\L26-ADFDocs-BestPractices\
17) ...\BATHandouts\OADFDocs-Downloaded\L27-ADFDocs-Miscellaneous\ADF Programmer Cheat Sheet.pdf
18) ...\BATHandouts\OADFDocs-Downloaded\L35-ADFDocs-Books\
19) ...\BATHandouts\OADFDocs-Downloaded\L35-ADFDocs-Tutorials\
Concepts:
20) Geometry Management
21) Scopes
22) Lifecycle and validation
23) Contextual event
24) Create or Expose as REST Web Service or as REST API
19/454
ADF Essentials Training by Deepak Bhagat
2
Understanding Development
Tool: JDeveloper
In this lab for this lesson, start JDeveloper, set preferences for the IDE, and create a JDeveloper
application, project and database connection.
20/454
ADF Essentials Training by Deepak Bhagat
2.1 Creating a New Fusion Application and Project -*
Start JDeveloper, create a new ADF Fusion Web Application named BATLab_02 with custom
settings and database connection. Also explore data control, overview page and generated files.
21/454
ADF Essentials Training by Deepak Bhagat
b) Expand the General (in the Categories list) > Applications > select ADF Fusion
Web Application (in the Items list). Click OK.
Create ADF Fusion Web Application wizard appears.
BAT
Page
BAT
BAT BAT
bat
22/454
ADF Essentials Training by Deepak Bhagat
i) In the Project Name field, enter HRService.
ii) Click Next.
BAT BAT
bat.
BAT BAT
BAT BAT
BAT
bat
BAT BAT
BAT BAT
h) Click Finish.
3) Notice that the Applications window displays your application and projects.
23/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
24/454
ADF Essentials Training by Deepak Bhagat
2.2 Creating a New Database Connection and Initialize the Project -*
BAT
25/454
ADF Essentials Training by Deepak Bhagat
c) In Oracle (JDBC) Settings section, leave the Driver field as thin, Host Name field
as localhost, JDBC Port field as 1521, SID field as XE respectively.
d) Click Test Connection.
The status box should display the word Success!.
e) Click OK. Click Save All .
26/454
ADF Essentials Training by Deepak Bhagat
2.3 Adding ADF Business Components and ADF Faces -*
Create new default business components such as entity objects, view objects and application
module. Also create a JSF page.
b) Ensure the Connection is hrconn (if the database connection is already created or
else click icon and follow the 2.2 above to create a new database connection). Click
OK.
Create Business Components from Tables wizard appears.
bat
Page
c) On the Entity Objects page of the wizard,
27/454
ADF Essentials Training by Deepak Bhagat
i) In the Package field, enter bat.lab.hrsystem.service.eo (note eo).
ii) Click the Query button to see the available tables.
iii) From the Available pane, select DEPARTMENTS and EMPLOYEES, click to
shuttle to the Selected pane.
bat
Page
iv) In the Selected pane, select the DEPARTMENTS, in the Entity Name field,
change to DepartmentEO (remove s).
Pane Pane
28/454
ADF Essentials Training by Deepak Bhagat
bat
Page
bat
Page
29/454
ADF Essentials Training by Deepak Bhagat
bat
bat
Page
30/454
ADF Essentials Training by Deepak Bhagat
BAT
bat
bat
bat
bat
bat
bat
31/454
ADF Essentials Training by Deepak Bhagat
a) Right-click the HRViewController > New > select Page.
bat
bat
bat
bat
bat
bat
BAT BAT
32/454
ADF Essentials Training by Deepak Bhagat
2.4 Exploring JDeveloper and New Application -*
bat
33/454
ADF Essentials Training by Deepak Bhagat
2.5 Exploring Windows of JDeveloper -*
Examine, explore, understand and familiarize with various windows of the JDeveloper.
BATLab_02
34/454
ADF Essentials Training by Deepak Bhagat
2.6 Working with Windows -*
2) All JDev Menus and menu items like File, Edit, View, Application, Refactor, Search, etc.
BAT
35/454
ADF Essentials Training by Deepak Bhagat
2.7 Taking Help using F1 key -*
1) Select or place the cursor on the object or context of which you need help.
2) Press F1 key for help.
Help window appears, which contains the detailed information regarding the selected object
or context.
36/454
ADF Essentials Training by Deepak Bhagat
2.8 Refactoring JDeveloper Artifacts -*
Refactor artifacts by renaming view object and moving diagram to appropriate package.
bat
37/454
ADF Essentials Training by Deepak Bhagat
Move Files window appears.
BAT BAT
BAT
bat
BAT
e) Select the service folder, create a new folder diagram by clicking icon and
select it.
f) Click the Select button.
Diagram moves from package bat.lab.hrsystem.service.am to
bat.lab.hrsystem.service.diagram
2) Save All.
38/454
ADF Essentials Training by Deepak Bhagat
2.9 Setting IDE Preferences -*
1) Set global naming preferences and packaging preferences for following ADF BC objects:
entity object, domain, association, view object, view link and application module.
a) Click the Tools menu > select Preferences.
Preferences wizard appears.
d) At the left pane, select Packages and enter Packages values as follows
39/454
ADF Essentials Training by Deepak Bhagat
e) Click OK. Save All.
2) Click the Tools menu > select Switch Roles, to switch default role to start JDeveloper, if
needed.
40/454
ADF Essentials Training by Deepak Bhagat
2.10 Setting Package Levels -*
Set the project package and web content levels to reduce number of levels.
BAT
bat
bat
bat
bat
bat
bat
41/454
ADF Essentials Training by Deepak Bhagat
2.11 Lab Solution
42/454
ADF Essentials Training by Deepak Bhagat
3
Modeling Database Schema
In this lab, you use the diagram modeler/editor to create a visual representation of the database
schema. You also create a new database component (a table) and create the DDL (Data Definition
Language) scripts to add the table to the schema.
43/454
ADF Essentials Training by Deepak Bhagat
3.1 Copying Application -o
BAT BAT
BAT
BAT
44/454
ADF Essentials Training by Deepak Bhagat
3.2 Exploring HR System ER Diagram -*
45/454
ADF Essentials Training by Deepak Bhagat
3.3 Examining Training Lab Application – Lab Solution 22 -*
46/454
ADF Essentials Training by Deepak Bhagat
3.4 Creating an Offline Database Diagram with Existing Schema Objects-o
Create a new offline database diagram (BAT_DB) with existing schema objects.
1) Expand the Application Resources window > Connections > Database > hrconn and
explore.
2) Right-click the HRService > New > select From Gallery.
New Gallery wizard appears.
3) Expand the General > Diagrams > select Database Diagram at right-side. Click OK.
Create Database Diagram wizard appears.
BAT
bat
BAT
BAT
10) Select the Offline Database, in Offline Database field enter BAT_DB.
11) Click OK. Save All.
48/454
ADF Essentials Training by Deepak Bhagat
3.5 Adding New Offline Database Schema Objects -o
Add new database schema object (GENDERS) to the newly created offline database (BAT_DB).
1) From the Components window (ensure Database page is selected), drag Table
component to the BATSchema.db_diagram editor.
BAT
BAT
Page
a) Click the Columns page (left side).
49/454
ADF Essentials Training by Deepak Bhagat
b) Clickthe icon (right end) to add a new column GENDER_ID.
i) In the Name column, enter GENDER_ID,
ii) In the Data Type column, change to Number,
iii) In the Size column, enter 4,
iv) In the Not NULL column, check the check box, to make it mandatory,
v) In the PK column, click inside column, to make it a primary key,
vi) Save All.
OR
vii) Click the Constraints page. Click icon and select New Primary Key
Constraint. From Available Columns, select GENDER_ID and shuttle it to
Selected Columns.
c) Similarly add another column GENDER_NAME with default values.
i) In the Name column, enter GENDER_NAME.
6) Save All.
50/454
ADF Essentials Training by Deepak Bhagat
3.6 Generating the SQL Scripts -o
Create and run scripts to create GENDER table in the Database and to insert data in it.
BAT
BAT BAT
BAT
51/454
ADF Essentials Training by Deepak Bhagat
c) On the SQL Script page of the wizard, in the File Name field change to
…\database\BAT_DB\createTableGender.sql. Click Next. Click Next. Click
Next. Click Next. Click Finish.
It creates createTableGender.sql file and opens in the editor
BAT
BAT
3) Go back to BATSchema.db_digram (if it is closed, expand the Recent Files window and
double-click the diagram).
4) In the Components window, drag Foreign Key from GENDER_ID of GENDERS table to
GENDER_ID of EMPLOYEES table. Click OK. Save All.
52/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
BAT
53/454
ADF Essentials Training by Deepak Bhagat
BAT
54/454
ADF Essentials Training by Deepak Bhagat
3.7 Running the SQL Scripts on Database -o
Run the all three scripts to create GENDER table and to insert data in the table.
55/454
ADF Essentials Training by Deepak Bhagat
3.8 Invoking PLSQL -x
This is part of advance ADF topic and a copy of this extended example (named
BATPLSQLIntgEg) may be found under …\BATHandouts\BATXtEg-Proprietary\L03-
BATXtEg-Database\. For hands-on practice, please refer to Deepak Bhagat’s Blog at
https://cloudadfdeepakb.blogspot.com or download from above location. It’s a lab sample on
invoking PLSQL.
56/454
ADF Essentials Training by Deepak Bhagat
4
Building Business Services with
Default Business Components
In this lab, you create a business model by using the wizards that are built into JDeveloper. You
see how to build a default model without any coding. In subsequent lessons and practices, you
learn to build and customize components to meet your specific application requirements.
57/454
ADF Essentials Training by Deepak Bhagat
4.1 Creating another New Application and Projects -*
Create an application BATLab_04 with default projects, with default packages and settings.
1) Create an application named BATLab_04 with package bat (as explained in Lab 2.1) and
with default projects, packages and settings.
a) Click the File menu > New > select Application.
New Gallery wizard appears.
b) Expand the General > Applications > select ADF Fusion Web Application.
c) Click OK.
Create ADF Fusion Web Application wizard appears.
BAT
BAT BAT
bat
BAT
58/454
ADF Essentials Training by Deepak Bhagat
4.2 Creating Default ADF Business Components -*
Create default business components; Entity Objects, View Objects and Application Module.
1) Create Business Components by using Create Business Components from Tables with
following details
Type of Object Package Objects Based on
bat.model.eo DepartmentsEO, DEPARTMENTS,
Entity Object
EmployeesEO EMPLOYEES tables
bat.model.vo
DepartmentsVO, DepartmentsEO,
Updatable VO
EmployeesVO EmployeesEO
Query-based VO bat.model.vo JobsVO JOBS tables
Application bat.model.am AppModuleAM
Module
a) Right-click the Model project > New > select Create Business Components from
Tables.
Initialize Business Components Project wizard appears.
59/454
ADF Essentials Training by Deepak Bhagat
BAT
60/454
ADF Essentials Training by Deepak Bhagat
bat
Page
i) Click the Query button. From Available pane, select DEPARTMENTS and
EMPLOYEES and shuttle them to Selected pane. Click Next.
ii) On the Entity-based View Objects page of the wizard. From Available pane,
shuttle DepartmentsEO and EmployeesEO to Selected pane. Click Next.
iii) On the Query-based View Objects page of the wizard. Click Query button.
From Available pane, select JOBS and shuttle them to Selected pane. Click
Next.
iv) Ensure the Add to Application Module checkbox is checked.
v) Click Next.
vi) Click Finish.
g) Save All.
61/454
ADF Essentials Training by Deepak Bhagat
4.3 Examining Generated ADF Business Components Artifacts -*
BAT
bat
bat
bat
bat
bat
bat
62/454
ADF Essentials Training by Deepak Bhagat
4.4 Testing the Business Service (using Oracle ADF Model Tester) -*
Test the business services which are created in earlier sections by using Oracle ADF Model Tester.
1) Run and test application module (AppModuleAM), using Oracle ADF Model Tester.
a) Right-click the (application module) AppModuleAM, select Run.
Oracle ADF Model Tester wizard appears.
2) Double-click the various object instances on the left side panel and test.
a) For example, double-click the EmpDeptFkVL1 and Jobs and observe the details on
right side panel.
b) Navigate through records by clicking right-arrow and left arrow .
63/454
ADF Essentials Training by Deepak Bhagat
4.5 Lab Solution
64/454
ADF Essentials Training by Deepak Bhagat
5
Persisting Data Using Entity
Objects
In this lab, you create entity objects for tables that the application will update and also create
associations.
65/454
ADF Essentials Training by Deepak Bhagat
5.1 Copying Application -o
Make a copy of application BATLab_04 and rename it to BATLab_05. Follow the steps, as
explained in Lab 3.1.
66/454
ADF Essentials Training by Deepak Bhagat
5.2 Creating Multiple Entity Objects at Once -*
Create following multiple entity objects at once by using Create Business Components from
Tables.
bat
4) Click Finish.
67/454
ADF Essentials Training by Deepak Bhagat
5.3 Creating an Association -*
(dependent on 5.3)
bat
2) On the Name page of the wizard, in the Name field enter JobHistDeptAS. Click Next.
3) On the Entity Objects page of the wizard,
a) From the Select Source Attribute pane, expand DepartmentsEO > select
DepartmentId and from Select Destination Attribute pane, expand
JobHistoryEO > select DepartmentId.
b) Click the Add button.
bat
bat
4) Click Next. Click Next. Click Next. Click Finish. Save All.
68/454
ADF Essentials Training by Deepak Bhagat
5.4 Examining Attribute Settings -*
1) Property Set: Select a named property set to apply to this attribute. A property set is a
version of an existing domain that is XML-only (no Java) and does not enforce a data type.
2) Effective Date: Specify effective date properties for the attribute. These options are
available only if the attribute type is Date.
3) Start Date: Select to indicate that this attribute is the start attribute of an effective dated
entity object.
4) End Date: Select to indicate that this attribute is the end attribute of an effective dated
entity object.
5) Sequence Flag: Select to indicate that this attribute stores a flag indicating the most recent
change in the sequence for an effective dated entity object.
6) Sequence: Select to indicate that this attribute stores a sequence of changes for an
effective dated entity object.
7) Updatable: You can enable the attribute to Always or Never be updatable or enable it to
be updated only before the entity is first posted (While New).
69/454
ADF Essentials Training by Deepak Bhagat
8) Queryable: Specify that this attribute can occur in the WHERE clause of a view object
(selected by default except for LOBs).
9) Precision Rule: Specifies that a validator is applied by the framework at runtime to enforce
the maximum precision and scale of the data type. If selected, the validation is performed
by the entity. If not selected, the validation is not performed by the entity and may result
in invalid precision/scale errors from the database when the transaction is committed.
10) Refresh on Insert/ Update: Specify whether to retrieve the value from the database
after an insert or update.
11) Change Indicator: Select this option if the column is a change indicator, such as a
timestamp, to be used to indicate that a row has been changed by another transaction. (If
no columns are specified as change indicators, ADF BC does a column-by-column
comparison.)
12) Effective Date: The attribute is either the start or end date of a date range for which the
entity row is effective (used for a point of time snapshot to answer such questions as what
an employee’s salary was on January 30, 2004.)
13) History Column: Select to use this column to log changes to the database. You can log
changes only if you have implemented Java Authentication and Authorization Service (JAAS)
authentication, the selected attribute is persistent, you have not selected Primary Key,
Mandatory, or Discriminator, and the attribute is Char, Character, String, Date, Timestamp,
or Number. After you have selected History Column, you can select the history column type
(created on or modified on for a Date or Timestamp attribute, created by or modified by for
a Char, Character, or Stringattribute, or version number for a Number attribute).
14) Generate Unique Constraint: Select to generate a UNIQUE constraint for this attribute.
It is often useful to define an attribute so that its values must be unique. For example, you
might want to enforce that every customer has a unique email address.
15) Sequence Name: Enter the name of the database sequence. The sequence name shown
on the Sequence tab is applicable only at design time when you use the Create Database
Tables feature. The sequence indicated here will be created along with the table on which
the entity object is based. This field is not available for all attribute types.
16) Start At: Enter an integer value you want the sequence to start at, the default value is 1.
This field is not available for all attribute types.
70/454
ADF Essentials Training by Deepak Bhagat
5.5 Creating Entity Object based on Database View -o
1) In the Applications window, right-click the Model project (or bat.model.eo package)
> New > select Entity Object.
Create Entity Object wizard appears.
bat
2) On the Name page of the wizard, in the Name field, enter EmpDetailsViewEO and click
Browse (next to the Schema Object).
Select Schema Object wizard appears.
71/454
ADF Essentials Training by Deepak Bhagat
bat
3) Click Next.
4) On the Attributes page of the wizard, select last two columns (CounrtyName and
RegionName). Click Remove. Click Next. (Removing is important for lab 5.4).
5) On the Attribute Settings page of the wizard, select EmployeeId and check Primay Key
check box to make it as Primary Key. Click Next. Click Next. Click Next. Click Finish. (See
lab 5.6 for details on each properties of the Attribute).
72/454
ADF Essentials Training by Deepak Bhagat
73/454
ADF Essentials Training by Deepak Bhagat
5.6 Synchronizing an Entity Object with Table Structure Changes -o
(dependent on 5.5)
74/454
ADF Essentials Training by Deepak Bhagat
5.7 Lab Solution
75/454
ADF Essentials Training by Deepak Bhagat
5.8 Applying Property Set -d
This Property Set topic is part of the Advance ADF extended example, taken from the web. For
optional self-paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L05-ADFXtEg-EntityObject.
76/454
ADF Essentials Training by Deepak Bhagat
6
Querying Data Using View
Objects
In this lab, you create view objects that are more customized for your application. You can also
create LOV, read-only view objects to support those LOVs and updatable view objects based on
entity objects and also create links between view objects. You can test these objects or instances
by using tester.
77/454
ADF Essentials Training by Deepak Bhagat
6.1 Copying Application -o
Make a copy of application BATLab_05 and rename it to BATLab_06. Follow the steps, as
explained in Lab 5.1.
78/454
ADF Essentials Training by Deepak Bhagat
6.2 Creating Read-Only View Object based on SQL Query -*
bat
79/454
ADF Essentials Training by Deepak Bhagat
4) Verify the Query: SELECT EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL,
PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT,
MANAGER_ID, DEPARTMENT_ID FROM EMPLOYEES.
81/454
ADF Essentials Training by Deepak Bhagat
6.3 Creating Updatable Join View Object -*
(Dependent on 4.2)
Create updatable join view object EmpSummaryVO in the bat.model.vo package, based on two
entity objects EmployeesEO and DepartmentsEO.
bat
bat
82/454
ADF Essentials Training by Deepak Bhagat
b) In the Selected pane, select DepartmentsEO. Ensure that Association is set to
EmpDeptFkAS.Departments1.
c) Notice that default Join Type is inner join.
d) Change the Join Type to left outer join.
e) Ensure that Updatable check box is NOT checked, and that Reference check box is
checked.
bat
bat
f) Select the EmployeesEO and ensure Updatable checkbox is checked. Click Next.
bat
bat
84/454
ADF Essentials Training by Deepak Bhagat
6.4 Adding View Object to Existing Application Module -*
(Dependent on 6.6)
bat
bat
bat
d) Save All.
85/454
ADF Essentials Training by Deepak Bhagat
6.5 Testing View Objects -*
Test view objects and view links by using Oracle ADF Model Tester. <<more elaborate steps req>
86/454
ADF Essentials Training by Deepak Bhagat
5) Create a new employee and commit.
6) Find/Search this particular employee record.
7) Update this record and commit.
8) Now remove filter/search and get all records.
9) Again, find record and edit details of an employee.
10) Delete record and rollback.
11) Delete record and commit.
12) Now find that record. Verify that it shows empty non- editable fields, as record does not
exist anymore.
13) For EmployeeId 100, change Salary to 240000 and tab out. Observe that there is no
error thrown. Change Salary to 2400000 and observe that error is thrown because
Salary range cannot be more than 6 digits.
14) Observe the format of HireDate is YYYY-MM-DD. Change HireDate to 2023-06-17 and
tab out. Observe that there is no error thrown even though HireDate is greater than
current date.
15) Observe that JobId is not an LOV and displays only the Job Id, not Job Title.
16) Observe that there is no field as Annual Salary.
87/454
ADF Essentials Training by Deepak Bhagat
88/454
ADF Essentials Training by Deepak Bhagat
6.6 Internationalizing through Resource Bundle -o
bat
89/454
ADF Essentials Training by Deepak Bhagat
6.7 Creating Read-Only View Object based on Static List -o
bat
b) Click on empty text boxes and provide values for the Attributes as shown in above
table. Click Next.
7) On the Application Module page of the wizard, check Add to Application Module.
Click Finish. Save All.
8) Right-click the AppModuleAM > select Run.
Oracle ADF Model Tester, wizard appears.
9) Double-click the CurrencyStatic1 and observe the result with static values.
91/454
ADF Essentials Training by Deepak Bhagat
6.8 Creating Multiple Read-Only View Objects at Once -o
Create following multiple read-only view objects at once by using Create Business Components
from Tables.
Tables Read Only View Objects
COUNTRIES CountriesVO
LOCATIONS LocationsVO
REGIONS RegionsVO
1) Right-click the bat.model.vo > New > select Business Components from Tables.
Create Business Components from Tables wizard appears.
2) Click Next till Query-based View Objects page.
3) On the Query-based View Objects page of the wizard,
a) Click the Query button.
b) Select COUNTRIES, LOCATIONS and REGIONS from Available pane and shuttle them
to Selected pane.
c) Click Next till Application Module page.
bat
4) On the Application Module page of the wizard, check Add to Application Module.
Click Finish.
5) Examine the newly generated links CountrRegFkVL and LocCIdFkVL that it is not based
on association unlike others.
6) Right-click the AppModuleAM > select Run.
Oracle ADF Model Tester wizard appears.
7) Double-click the LocCIdFkVL1 and CountrRegFkVL1 and observe the result with read-
only values.
92/454
ADF Essentials Training by Deepak Bhagat
93/454
ADF Essentials Training by Deepak Bhagat
6.9 Creating View Link -o
Manually create a Master-Detail relationship between two view objects (LocationsVO and
DepartmentsVO) using view link (DeptLocVL).
bat
2) On the Name page of the wizard, in the Name field enter DeptLocVL. Click Next.
3) On the View Objects page of the wizard,
a) From Select Source Attribute pane, expand bat.model.vo > LocationsVO >
select LocationId and from Select Destination Attribute pane expand
DepartmentsVO > select LocationId.
b) Click the Add button.
bat
c) Click Next. Click Finish. (Note Do NOT check Add to Application Module).
94/454
ADF Essentials Training by Deepak Bhagat
6.10 Adding Child VO to Master VO Through Link in Existing AM -o
(Dependent on 6.9)
Add master view object (LocationsVO) and child view object (DepartmentsVO) via view link
(DeptLocVL) to application module (AppModuleAM). <<Make all other objectives clear>>
bat
95/454
ADF Essentials Training by Deepak Bhagat
6.11 Testing View Objects and Link -o
Test view objects and view links by using Oracle ADF Model Tester.
96/454
ADF Essentials Training by Deepak Bhagat
6.12 Lab Solution
97/454
ADF Essentials Training by Deepak Bhagat
7
Exposing Business Service
through Application Module
In this lab, you create nested application module and add view objects to that application module
which are no longer required.
98/454
ADF Essentials Training by Deepak Bhagat
7.1 Copying Application -o
Make a copy of application BATLab_06 and rename it to BATLab_07. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
99/454
ADF Essentials Training by Deepak Bhagat
7.2 Creating New Nested Application Module -o
bat
bat
bat
bat
100/454
ADF Essentials Training by Deepak Bhagat
bat
bat
101/454
ADF Essentials Training by Deepak Bhagat
7.3 Lab Solution
102/454
ADF Essentials Training by Deepak Bhagat
8
Declaratively Customizing
Business Services
In this lab, you make declarative modifications to your business components such as defining
control hints, creating alternate key, populating primary key, adding transient attribute, creating
list of values, creating view criteria and using groovy.
103/454
ADF Essentials Training by Deepak Bhagat
8.1 Copying Application -o
Make a copy of application BATLab_07 and rename it to BATLab_08. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
104/454
ADF Essentials Training by Deepak Bhagat
8.2 Customizing Entity Objects by Defining Control Hints -*
(Dependent on 4.3)
105/454
ADF Essentials Training by Deepak Bhagat
d) Click OK. Save All.
106/454
ADF Essentials Training by Deepak Bhagat
8.3 Customizing View Object by Adding Transient Attribute -*
(Dependent on 6.6)
4) In the Name field enter AnnualSalary, in the Type field select BigDecimal, Click OK.
5) Select the AnualSalary attribute, click UI Hints tab, in the Width field enter 10.
107/454
ADF Essentials Training by Deepak Bhagat
6) Click the Details tab, select Expression radio button under Default Value section, click
Edit expression icon.
Edit Expression Editor wizard appears.
7) In the Expression textbox, enter Salary!=null?Salary*12:null. Click OK. Save All.
108/454
ADF Essentials Training by Deepak Bhagat
8.4 Defining List of Values and Accessors -*
(Dependent on 6.6)
a) In the List Data Source field, select JobsVO1 by clicking icon and selecting
JobsVO from View Accessors dialog box.
b) In the List Attribute field, select JobId from the drop-down.
c) Click the UI Hints tab,
109/454
ADF Essentials Training by Deepak Bhagat
i) In the Default List Type field, select Combo Box with List of Values from
the drop-down
ii) From the Available pane, select JobTitle and shuttle it to Selected pane.
iii) Click OK. Save All.
OR
5) Alternatively, Click the Accessors page and click icon.
View Accessors wizard appears.
bat
bat
8) Save All.
9) Click the Accessors page, observe the View Accessors.
bat
bat
111/454
ADF Essentials Training by Deepak Bhagat
112/454
ADF Essentials Training by Deepak Bhagat
8.5 Creating View Object with Parameterized Where Clause -*
bat
113/454
ADF Essentials Training by Deepak Bhagat
Oracle ADF Model Tester wizard appears.
b) Double-click the EmpByEmail1.
Bind Variables dialog box appears.
c) In the Value field, enter AKHOO. Click OK.
d) It shows FirstName, LastName and Email values in read-only mode.
114/454
ADF Essentials Training by Deepak Bhagat
8.6 Creating and Using Parameterized View Criteria -o
(Dependent on 6.4)
115/454
ADF Essentials Training by Deepak Bhagat
6) Similarly, create another view criteria named EmpByEmailVC. In the Attribute field select
Email, in the Operator field select Equals, in the Operand field select Bind Variable
and add Parameter as p_email. Click OK. Save All.
116/454
ADF Essentials Training by Deepak Bhagat
d) It shows the employee details with Department Id 80.
117/454
ADF Essentials Training by Deepak Bhagat
e) Similarly, double-click the EmpSqlQuery1, click the Search icon. Shuttle
EmpByEmailVC. (Move back EmpByDeptVC). Click Find. In the Value field enter
AKHOO. Click OK.
f) It shows the employee details with Email AKHOO.
118/454
ADF Essentials Training by Deepak Bhagat
8.7 Creating Alternate Key Entity Constraints -o
(Dependent on 6.6)
1) Right-click the EmployeesEO > select New Entity Constraint (from context menu).
Create Entity Constraint wizard appears.
2) On the Name page of the wizard, keep default values. Click Next.
3) On the Attributes page of the wizard, from the Available pane, select PhoneNumber and
shuttle it to Selected pane. Click Next.
4) On the Properties page of the wizard, select Alternate radio button (under Key Type
section). Click Cancel (Do NOT Save).
119/454
ADF Essentials Training by Deepak Bhagat
8.8 Declaratively Populating Primary Key with a Database Sequence -o
(Dependent on 6.6)
120/454
ADF Essentials Training by Deepak Bhagat
8.9 Lab Solution
121/454
ADF Essentials Training by Deepak Bhagat
8.10 References for Groovy -o
122/454
ADF Essentials Training by Deepak Bhagat
8.11 Defining Dependent List of Values (LOV) -x
Create a new application, displaying Locations containing Country LOV and State Province LOV,
where State Province LOV is dependent on Country LOV. This would demonstrate that State
Province LOV is dependent on Country LOV and hence called Dependent LOV.
This topic is part of advance ADF extended example (BATDependentLOV-Eg) may be found
under …\BATHandouts\BATXtEg-Proprietary\L08-BATXtEg-DeclCustomization.
For hands-on practice, please refer to Deepak Bhagat’s Blog at
https://cloudadfdeepakb.blogspot.com or download from the above location. It's a lab sample on
creating dependent or cascading List of Values (LOV).
123/454
ADF Essentials Training by Deepak Bhagat
8.12 View Criteria using Custom Operator -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L08-ADFXtEg-DeclCustomization.
124/454
ADF Essentials Training by Deepak Bhagat
9
Validating in Business Services
In this lab, you add several types of declarative validation to entity objects and view objects.
125/454
ADF Essentials Training by Deepak Bhagat
9.1 Copying Application -o
Make a copy of application BATLab_08 and rename it to BATLab_09. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
126/454
ADF Essentials Training by Deepak Bhagat
9.2 Adding Declarative Validation: Range Validator -*
127/454
ADF Essentials Training by Deepak Bhagat
BAT
128/454
ADF Essentials Training by Deepak Bhagat
9.3 Generating Java Files for Entity Objects -*
bat
4) Check the Generate Entity Object Class, check the methods Accessors, Create
Method, Data Manipulation Methods and Remove Method options if needed.
5) Click OK. Save All.
6) In the Java Classes section, observe the newly created java class
bat.model.eo.EmployeesEOImpl. (as shown in step-3 diagram)
7) And also expand the EmployeesEO, double-click the EmployeeEOImpl.java to open it
in the editor.
129/454
ADF Essentials Training by Deepak Bhagat
8) Explore the entity object java class.
BAT
bat
bat
bat
bat
bat
bat
bat
bat
bat
130/454
ADF Essentials Training by Deepak Bhagat
9.4 Adding Method Validator -*
Add a method validator to validate Hire Date such that it must be on or before current date.
131/454
ADF Essentials Training by Deepak Bhagat
a) In the Display Value textbox, enter BAT_ERROR: Hire Date must be on or
before {p_cd}.
b) In the Key textbox, enter BAT_ERROR_HIRE_DATE.
c) Click Save and Select.
9) In the Token Message Expressions section, enter Expression value of p_cd as
adf.currentDate.
10) Click OK. Save All.
11) Open the EmployeesEOImpl.java in the editor.
12) Add the following code inside validateHireDate() method. (Copy code from file
…\BATHandouts\BATLabs-SrcCodes\L09-Codes-
Validation\EmployeesEOImpl.java.).
System.out.println(" In EmployeesEOImpl.validateHireDate() ");
if(hiredate != null && hiredate.before(new java.util.Date()))
return true;
else
return false;
13) Save All and Make (right-click in the editor, select Make from context menu).
132/454
ADF Essentials Training by Deepak Bhagat
BAT
d) Correct HireDate to be less than or equal to current date. Populate all mandatory
fields. Tab out.
133/454
ADF Essentials Training by Deepak Bhagat
9.5 Adding Declarative Validation: Unique Key Validator -o
BAT
BAT
BAT
BAT
4) Save All.
5) Run the AppModuleAM and test validation by creating new Employee.
135/454
ADF Essentials Training by Deepak Bhagat
a) Run the AppModuleAM.
b) Double-click the Employees1.
c) Click icon.
d) In the EmployeeId field, enter existing value 100 and tab out.
e) System prompts an error message by saying BAT_HR_ERROR: You have entered
duplicate ID 100.
BAT
136/454
ADF Essentials Training by Deepak Bhagat
9.6 Lab Solution
137/454
ADF Essentials Training by Deepak Bhagat
9.7 Adding Domain Validator -x
Create a domain for a Phone Number data type. You then apply that domain
BATPhoneNumberDO as the data type for an Employee PhoneNumber attribute.
This topic is part of advance ADF extended example (BATDependentLOV-Eg) may be found
under …\BATHandouts\BATXtEg-Proprietary\L09-BATXtEg-Validation. For hands-
on practice, please refer to Deepak Bhagat’s Blog at https://cloudadfdeepakb.blogspot.com or
download from the above location. It's a lab sample on creating and using a domain instead of
data type.
138/454
ADF Essentials Training by Deepak Bhagat
9.8 Demonstrate Various Types of Validations -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L09-ADFXtEg-Validation\.
These examples demonstrate all types of validations in ADF BC.
139/454
ADF Essentials Training by Deepak Bhagat
10
Introducing User Interface
Technologies
In this lab, you navigate through the application and you check all the functionalities such as
page flows, navigations, searches, transactions, CRUD operations, etc.
140/454
ADF Essentials Training by Deepak Bhagat
10.1 Running, Exploring and Familiarizing Lab 20 Application -*
Run the lab application BATLab_20, explore and familiarize User Interface (UI) flows and the
functionalities such as page flows, navigations, searches, transactions, CRUD operations, etc.
BAT BAT
BAT
141/454
ADF Essentials Training by Deepak Bhagat
3) Check the Quick Search functionality.
a) In the Quick Search section,
i) In the Email field, enter AKHOO,
ii) Click Search button.
iii) It displays the First Name, Last Name and Email values as Alexander, Khoo
and AKHOO associated with the entered email.
BAT
142/454
ADF Essentials Training by Deepak Bhagat
BAT
6) Check the Printable Page, Export to Excel functionalities and different menus available in
the table.
a) Test the Printable Page functionality.
i) Click the BATMenu and select Printable Page from the submenu.
BAT
ii) It displays the Departments-Employees details in new tab which is available for
printing.
b) Test the Export to Excel functionality.
i) Click the BATMenu and select Export to Excel from the submenu.
143/454
ADF Essentials Training by Deepak Bhagat
BAT
ii) It displays a window which allows you to open or download the Employees record
in excel format.
c) Test the View menu.
i) Click the View menu and select required submenu and test.
BAT
BAT
144/454
ADF Essentials Training by Deepak Bhagat
d) Or you can use breadcrumbs to navigate back. Click the Employee List link on top,
then it navigates back to Employee List page.
8) Check the Search functionality.
a) Click Employee Search tab, it navigates to Employee Search page and displays
search fields.
b) You can search the records by providing any value in the search fields. The result will
be shown in below table accordingly.
c) For example, in the LastName field enter A% and click Search button or press Enter.
d) It displays the Employee records in the below table whose LastName starts with A.
145/454
ADF Essentials Training by Deepak Bhagat
e) Click Reset button to clear or reset fields.
f) Click Advanced button to search the records by using advanced options.
146/454
ADF Essentials Training by Deepak Bhagat
10) Check the Update and Train sequence functionalities.
a) Click Update button.
b) Modify the employee details and click Save button.
147/454
ADF Essentials Training by Deepak Bhagat
11) Check the Delete functionality.
a) Select one particular record and click Delete button.
b) It displays a Popup with Yes and No buttons.
c) Click Yes to delete the record.
d) Now check that particular record. It won’t display as it is deleted.
148/454
ADF Essentials Training by Deepak Bhagat
11
Getting Started with User
Interface and UI Components
In this lab, you create a new application. You then set-up project for internationalization and skin
preference.
149/454
ADF Essentials Training by Deepak Bhagat
11.1 Creating New Application with only ViewController Project -*
Create a new application BATLab_11 with default projects, with default packages and settings.
1) Create an application named BATLab_11 with package bat and with default projects,
packages and settings.
a) Click the File menu > New > select Application.
New Gallery wizard appears.
b) Expand the General > Applications > select ADF Fusion Web Application.
c) Click OK.
Create ADF Fusion Web Application wizard appears.
BAT
BAT BAT
bat
b) Choose the relevant option and click Yes button. Click Yes again. Save All.
4) Close the JDeveloper.
5) Under the …\BATLab_11\ folder, delete Model folder.
BAT BAT
BAT
151/454
ADF Essentials Training by Deepak Bhagat
11.2 Setting Up the UI Project for Internationalization -*
bat
152/454
ADF Essentials Training by Deepak Bhagat
11.3 Setting Up the Skin Preference -*
BAT
153/454
ADF Essentials Training by Deepak Bhagat
11.4 Lab Solution
154/454
ADF Essentials Training by Deepak Bhagat
11.5 ADF Faces Rich Client Components -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L11-ADFXtEg-RichUIComp\.
These examples demonstrate ADF Faces Rich Client Components.
155/454
ADF Essentials Training by Deepak Bhagat
12
Planning Pages using Layout
Components
You could continue developing pages, but it is usually helpful to plan out the application before
creating all the pages. In this lab, you create a new JSF page, add default layouts to the page
like Panel Splitter, Panel Accordion, Panel Tabbed to enhance the appearance of the application
and customize the layouts. This enables you to visualize the flow of the application.
156/454
ADF Essentials Training by Deepak Bhagat
12.1 Copying Application -o
Make a copy of application BATLab_11 and rename it to BATLab_12. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
157/454
ADF Essentials Training by Deepak Bhagat
12.2 Creating New JSF Page -*
BAT
BAT BAT
158/454
ADF Essentials Training by Deepak Bhagat
12.3 Adding Default Layout Components -*
Add default layouts to the page such as Panel Splitter, Panel Accordion and Panel Tabbed layouts
as follows.
BAT
159/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
3) Add another Panel Splitter to 2nd facet of 1st Panel Splitter with defaults.
a) In the Structure window, expand af:panelSplitter-vertical > Panel
Splitter facets > select f:facet-second.
b) Drag the Panel Splitter to f:facet-second in the Structure window or in the
editor (or you can select facet and just click on Panel Splitter it will be added
automatically).
BAT
BAT
160/454
ADF Essentials Training by Deepak Bhagat
4) Add the Panel Accordion layout to the page.
a) Add the Panel Accordion to 1st facet of the 2nd Panel Splitter.
Create Panel Accordion window appears.
161/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
BAT BAT
162/454
ADF Essentials Training by Deepak Bhagat
12.4 Customizing Layout Components -*
BAT
163/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT BAT
164/454
ADF Essentials Training by Deepak Bhagat
12.5 Lab Solution
165/454
ADF Essentials Training by Deepak Bhagat
13
Designing User Interfaces and
Page Flows
In this lab, you create both unbounded and bounded task flows, along with various types of
activities and control flows for each. You also extract part of an unbounded task flow into its own
flow and convert an unbounded task flow to a bounded one.
Following list of Task Flows will be created, along with corresponding Page Fragments. Each
page fragment (.jsf or .jsff) will contain a Panel Group Layout. Further Additional
Components will be added inside Panel Group Layout as shown in table below.
Additional Additional
Task Flow Page Fragment
Component Component Text
EmpListTF EmpListPF Panel Box Departments
Panel Box Employees
Panel Collection
EmpDetailTF EmpDetailPF Panel Header Employee Detail
LocDeptsTF LocDeptsPF Output Text Loc-Depts
EmpQuickSearchTF EmpQuickSearchPF Output Text Quick Search
EmpSearchTF EmpSearchPF Panel Header Employee Search
Panel Collection
EmpCreateTF EmpCreatePF Panel Box Employee Create
At the end of this hands-on lab practices, the structure of newly created task flows and fragments
should appear as shown in the below diagram.
BAT
166/454
ADF Essentials Training by Deepak Bhagat
13.1 Copying Application -o
Make a copy of application BATLab_12 and rename it to BATLab_13. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
167/454
ADF Essentials Training by Deepak Bhagat
13.2 Creating Bounded Task Flows and Add View Activities -*
Create bounded task flows with page fragments and add view activities, as shown below.
Task Flow View Activity Name
EmpListTF EmpListPF
EmpDetailTF EmpDetailPF
EmpQuickSearchTF EmpQuickSearchPF
EmpSearchTF EmpSearchPF
EmpCreateTF EmpCreatePF
1) Right-click the ViewController project > New > select ADF Task Flow.
Create Task Flow wizard appears.
2) In the File Name field, enter EmpQuickSearchTF, ensure Create as Bounded Task
Flow and Create with Page Fragments are selected. Remaining boxes should be
unchecked.
BAT BAT
3) Click OK.
4) It creates EmpQuickSearchTF.xml task flow and opens in the editor.
5) In the Components window, select View activity, drag it to the
EmpQuickSearchTF.xml, change its name to EmpQuickSearchPF.
6) Save All.
7) Similarly, create four more task flows EmpListTF, EmpDetailTF, EmpSearchTF and
EmpCreateTF and add View activities EmpListPF, EmpDetailPF, EmpSearchPF and
EmpCreatePF, as mentioned above.
168/454
ADF Essentials Training by Deepak Bhagat
13.3 Creating New Page Fragments -*
BAT BAT
b) Ensure all default settings that options Facelets and Create Blank Page are
selected.
c) Leave all fields default and click OK. Save All.
d) It creates EmpQuickSearchPF.jsff page and opens in the editor.
e) Drag the Panel Group Layout (as outmost layer).
f) Drag the Output Text (inside Panel Group Layout), change its text to Quick Search.
g) Save All.
169/454
ADF Essentials Training by Deepak Bhagat
4) Open the EmpSearchTF in the editor.
a) Double-click the EmpSearchPF.
Create ADF Page Fragment wizard appears.
b) Leave all fields default and click OK.
c) Drag the Panel Group Layout (as outmost layer).
d) Drag the Panel Header layout (inside Panel Group Layout), change its text to
Employees Search.
e) Drag the Panel Collections (inside Panel Group Layout).
f) Save All.
5) Open the EmpCreateTF in the editor.
a) Double-click the EmpCreatePF.
Create ADF Page Fragment wizard appears.
b) Leave all fields default and click OK.
c) Drag the Panel Group Layout (as outmost layer).
d) Drag the Panel Box layout (inside Panel Group Layout), change its text to Employee
Create.
6) Ensure following details are incorporated (where PG stands for Panel Group Layout):
Task Flow Page Fragment Additional Additional
Component Component Text
EmpListTF EmpListPF PG +Panel Box Departments
+Panel Box Employees
++Panel Collection
EmpDetailTF EmpDetailPF PG +Panel Header Employee Detail
EmpQuickSearchTF EmpQuickSearchPF PG +Output Text Quick Search
EmpSearchTF EmpSearchPF PG +Panel Header Employee Search
+Panel Collection
EmpCreateTF EmpCreatePF PG +Panel Box Employee Create
7) The generated artifacts should appear as following.
BAT
170/454
ADF Essentials Training by Deepak Bhagat
13.4 Adding Task Flow Call Activities -*
BAT
171/454
ADF Essentials Training by Deepak Bhagat
13.5 Adding Return Activities -*
Add return activities and control flow cases. (Dependent on 13.3, 13.7)
172/454
ADF Essentials Training by Deepak Bhagat
13.6 Using Bounded Task Flows as a Region on a page -*
BAT
BAT
173/454
ADF Essentials Training by Deepak Bhagat
7) If the EmpListPF is not rendered properly, open EmpListTF.xml in the editor. Select
EmpListPF > right-click > Mark Activity > select Default Activity (from context-menu).
OR
Select EmpListPF > Click on Default Activity icon.
174/454
ADF Essentials Training by Deepak Bhagat
13.7 Creating Bounded Task Flow without Fragments -o
1) Right-click ViewController project > New > select ADF Task Flow.
Create Task Flow wizard appears.
BAT BAT
175/454
ADF Essentials Training by Deepak Bhagat
13.8 Converting Bounded Task Flows to Use Page Fragments -o
Convert bounded task flows to use page fragments.
3) Convert To Task Flow With Page Fragments dialog box appears, click OK. Click Yes.
4) Observe the LocDeptPF.jsf have been converted to LocDeptPF.jsff.
176/454
ADF Essentials Training by Deepak Bhagat
13.9 Using Unbounded Task Flow with View and Control Flow Activities -o
BAT BAT
178/454
ADF Essentials Training by Deepak Bhagat
13.10 Extracting Part of Task Flow -o
BAT BAT
180/454
ADF Essentials Training by Deepak Bhagat
13.11 Lab Solution
181/454
ADF Essentials Training by Deepak Bhagat
13.12 Using URL View Activity -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L13-ADFXtEg-TaskFlow\.
This example demonstrates URL View Activity in ADF Task Flow.
182/454
ADF Essentials Training by Deepak Bhagat
14
Interactively Controlling with
Navigation Components
In this lab, you implement navigation on pages by creating buttons, links, breadcrumbs, and a
train.
So far you have created several pages that are part of task flows, and you have created control
flows between them with outcomes that can be used for navigation. However, you have not
implemented navigation on the pages, so there is no mechanism for moving from one activity to
the next within task flows.
183/454
ADF Essentials Training by Deepak Bhagat
14.1 Copying Application -o
Make a copy of application BATLab_13 and rename it to BATLab_14. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
184/454
ADF Essentials Training by Deepak Bhagat
14.2 Adding Links and Buttons for Navigation -*
e) Save All.
2) Add the button component in the EmpDetailPF page.
185/454
ADF Essentials Training by Deepak Bhagat
a) Open the EmpDetailPF.jsff page in the editor.
b) In the Components window, select Button, drag it to the toolbar of
panelHeader-Employee Detail (in Structure window).
c) In the Structure window, select af:button-button1.
d) In the Properties window,
i) In the Text property, enter Done,
ii) In the Action property, select done.
e) Save All.
186/454
ADF Essentials Training by Deepak Bhagat
BAT
187/454
ADF Essentials Training by Deepak Bhagat
ii) In the Action property, select create.
e) Save All.
188/454
ADF Essentials Training by Deepak Bhagat
6) Run the BATIndex page and test.
link
189/454
ADF Essentials Training by Deepak Bhagat
190/454
ADF Essentials Training by Deepak Bhagat
14.3 Using Menu and Menu Items -*
BAT
d) In the Structure window, right-click af:menu-BATMenu > Insert Inside Menu >
select Menu Item.
e) In the Properties window, in the Text property, enter Printable Page.
f) Add another Menu Item and change its Text to Export to Excel.
g) In the Structure window, select af:commandMenuItem-Printable Page. In the
Components window, drag and drop Show Printable Page Behavior (or just click
on it to add).
h) Save All.
191/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
192/454
ADF Essentials Training by Deepak Bhagat
14.4 Assigning Internationalization and Accessibility -o
Internationalization and Accessibility: Using Resource Bundle, Access Key and Defining Tool Tips.
193/454
ADF Essentials Training by Deepak Bhagat
Note that accessKey is triggered by browser-specific and platform-specific modifier keys.
For e.g., IE will set focus when you press Alt+<accessKey>. FF & Chrome sets focus on
some operating systems when you press Alt+Shift+<accessKey>. FF & Chrome on
other operating systems sets focus when you press Control+<accessKey>. Refer to your
browser's documentation for how it treats access keys.
6) Run the BATIndex page and test.
194/454
ADF Essentials Training by Deepak Bhagat
14.5 Using BreadCrumbs -o
BAT
196/454
ADF Essentials Training by Deepak Bhagat
14.6 Using Popup Dialog -o
c) In the Structure window, select af:dialog, in the Properties window, in the Type
property select ok and in the Title property enter Department Salary.
d) In the Structure window, click icon to go back.
3) Add Link component and add Show Popup Behavior to it.
a) Add the Link component to af:panelBox-Department and change its Text to
Department Name.
b) In the Structure window, right-click af:link-Department Name > Insert
Inside Link > ADF Faces.
Insert ADF Faces Item wizard appears.
c) Select the Show Popup Behavior. Click OK.
Insert Show Popup Behavior dialog box appears.
d) In the PopupId field, enter p1, Click OK.
e) You can select PopupId value by clicking icon > Edit > selecting popup-p1 >
clicking OK.
f) Save All.
4) Run the BATIndex page and test the Popup.
197/454
ADF Essentials Training by Deepak Bhagat
BAT
198/454
ADF Essentials Training by Deepak Bhagat
14.7 Defining Sequence of Steps (Train) and Use Wild Card Activity -o
BAT BAT
199/454
ADF Essentials Training by Deepak Bhagat
2) Create the page fragments from the view activities.
a) Double-click the EmpUpdatePersonPF.
Create ADF Page Fragment wizard appears.
b) Leave everything default and click OK.
c) It creates EmpUpdatePersonPF.jsff page and opens in the editor.
d) Double-click the EmpUpdateJobPF.
Create ADF Page Fragment wizard appears.
e) Leave everything default and click OK.
f) It creates EmpUpdateJobPF.jsff page and opens in the editor.
g) Double-click the EmpUpdateConfirmPF.
Create ADF Page Fragment wizard appears.
h) Leave everything default and click OK.
i) It creates EmpUpdateConfirmPF.jsff page and opens in the editor.
3) Add the Panel Group Layout, Train component, Panel Header, TrainButtonBar and Buttons
in all the three pages (i.e. EmpUpdatePersonPF, EmpUpdateJobPF and
EmpUpdateConfirmPF).
4) Open the EmpUpdatePersonPF page in the editor.
a) Add the Panel Group Layout to the page.
b) Add the Train component to af:panelGroupLayout .
Bind train dialog box appears.
c) Ensure the Value is
#{controllerContext.currentViewPort.taskFlowContext.trainModel}.
d) Click OK.
e) Add the Panel Header to af:panelGroupLayout and change its Text to
Employee Update Person.
f) Add the Train Button Bar to Panel Header’s f:facet-toolbar.
Bind trainButtonBar dialog box appears.
g) Ensure the Value is
#{controllerContext.currentViewPort.taskFlowContext.trainModel}.
h) Click OK.
i) Add the Button to Panel Header’s f:facet-toolbar.
j) In the Properties window, in Text property, enter Cancel and in Action property,
select cancel.
200/454
ADF Essentials Training by Deepak Bhagat
5) Similarly, do the same process for EmpUpdateJobPF and EmpUpdateConfirmPF
respectively.
6) In the EmpUpdateConfirmPF page. Add additional Button, change its Text to Submit
and Action to save.
7) Add the task flow call activity.
a) Open the EmpSearchTF page in the editor.
b) Drag the EmpUpdateTF to the editor as task flow call activity.
c) Add the Control Flow Case from EmpSearchPF to EmpUpdateTF and change its
name to update.
201/454
ADF Essentials Training by Deepak Bhagat
9) Ensure that all buttons and trainButtonBar are inside Panel Header’s toolbar.
10) Save All.
11) Run the BATIndex.jsf page and test the train sequence.
202/454
ADF Essentials Training by Deepak Bhagat
203/454
ADF Essentials Training by Deepak Bhagat
14.8 Lab Solution
204/454
ADF Essentials Training by Deepak Bhagat
15
Ensuring Reusability in Web
Applications
In this lab, you begin to implement reusability in the application.
When several pages are used in succession, it is a good practice to make sure that the layout of
each page is exactly the same. For example, you want navigation buttons to appear in exactly
the same location on pages that are used in series, such as train sequence. To make the layout
cleaner and reusable, you create and apply a template to the pages.
205/454
ADF Essentials Training by Deepak Bhagat
15.1 Copying Application -o
Make a copy of application BATLab_14 and rename it to BATLab_15. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
206/454
ADF Essentials Training by Deepak Bhagat
15.2 Creating and Using Reusable Component -*
(Dependent on 8)
BAT
BAT
BAT
207/454
ADF Essentials Training by Deepak Bhagat
5) Ensure the Profile Type is ADF Library Jar File and in Deployment Profile Name
field, enter Model. Click OK.
Edit ADF Library JAR Deployment Profile Properties window appears.
6) Click the Jar Options page.
a) In the JAR File field, enter …\BATJDev122100\mywork\deploy\Model.jar.
b) Click OK. Save All.
7) In case the Jar Option in previous step is not selected,
a) Select the Model > Project Properties > Deployment > Model (ADF Library
JAR File).
b) Click .
c) Click the Jar Options page.
d) In the JAR File field, enter …\BATJDev122100\mywork\deploy\Model.jar.
e) Click OK. Click OK. Save All.
BAT BAT
BAT
BAT
BAT
BAT
208/454
ADF Essentials Training by Deepak Bhagat
If there is no Resources window at right-side. Click Window menu > select Resources to
open the window.
BAT
BAT
13) In the Connection Name field, enter modelLib and in the Directory Path field, enter
…\BATJDev122100\mywork\deploy. (or select appropriate path by clicking Browse)
14) Click the Test Connection in window. Click OK. Save All.
209/454
ADF Essentials Training by Deepak Bhagat
15) In the Resources window, expand File System > modelLib > right-click Model.jar >
select Add to Project. Click Add Library in the dialog box.
BAT
BAT
18) Explore the Data the Control window and show no data model is exposed.
210/454
ADF Essentials Training by Deepak Bhagat
BAT
211/454
ADF Essentials Training by Deepak Bhagat
15.3 Creating Page Templates -o
BAT BAT
d) In the Template Content page of the wizard, ensure Blank Template is selected.
e) Click Next.
212/454
ADF Essentials Training by Deepak Bhagat
EmpUpdateTemplage.jsf template opens in the editor.
2) In the page template, add Panel Group Layout. In the Properties window, in the Layout
field, select Scroll.
3) Add the Train component to af:panelGroupLayout, in the Properties window, in
Value field, enter
#{controllerContext.currentViewPort.taskFlowContext.trainModel}.
(You can use Expression Builder. Click icon next to Value > select Expression Builder
>In Expression Builder wizard, expand ADF Controller Objects > controllerContext
> currentViewPort > taskFlowContext > trainModel to insert into expression.).
4) Add the Panel Header layout to af:panelGroupLayout, change its Text to
#{attrs.title}.
5) Add the Facet Definition to af:panelHeader. (You can search in Components window
as Facet Definition.)
Insert Facet Definition dialog box appears.
6) In the Facet Name field, select content from drop-down list. Click OK.
7) Add the Toolbar to Panel Header’s f:facet-toolbar.
8) Add the Train Button Bar to af:toolbar and in the Properties window, in the Value
field, enter #{controllerContext.currentViewPort.taskFlowContext.trainModel}.
9) Add the Button to af:toolbar and change its Text to Save and Close, change Action
to save.
10) In the Structure window, select button-Save and Close, in the Properties window,
in the Disabled property field, enter
#{controllerContext.currentViewPort.taskFlowContext.trainModel.next!=null} (by
using Expression Builder).
213/454
ADF Essentials Training by Deepak Bhagat
11) Add the Button before trainButtonBar and change its Text to Cancel, Action to
cancel, select Immediate property to true. (Note: if you use Expression Builder, it
displays the code as an error. It has context for trainModel, but does not understand
‘.next’ in expression. You can ignore the error.).
12) Save All.
BAT
bat
bat
BAT
214/454
ADF Essentials Training by Deepak Bhagat
215/454
ADF Essentials Training by Deepak Bhagat
15.4 Applying Template to Existing Page Fragments -o
(Dependent on 14.7)
216/454
ADF Essentials Training by Deepak Bhagat
4) In the Structure window, select af:pageTemplate.
5) In the Properties window, in the title field, enter Emp Update Person. Save All.
217/454
ADF Essentials Training by Deepak Bhagat
15.5 Creating a New Header Template -o
1) Right-click the VeiwController > New > select ADF Page Template.
Create a Page Template wizard appears.
BAT
BAT BAT
BAT
218/454
ADF Essentials Training by Deepak Bhagat
7) BATHeaderTemplate.jsf template opens in the editor. Ensure Panel Splitter’s
Orientation property is vertical.
8) Add the Panel Group Layout to 1st facet of panelSplitter and in Properties window,
in Layout field, select Horizontal.
9) Add images to the header.
a) Copy the image folder into
mywork\BATLab_15\ViewController\public_html folder.
b) In the JDeveloper Refresh project.
c) Expand the ViewController > Web Content > image folder,
i) Select and drag the bat-logo.png to the page (to Panel Group Layout), select
ADF Faces Image (from context menu),
BAT
BAT
bat
bat
bat
bat
219/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
bat
bat
220/454
ADF Essentials Training by Deepak Bhagat
15.6 Applying Template to Existing Page -o
(Dependent on 15.4)
BAT
BAT
BAT
BAT
BAT
221/454
ADF Essentials Training by Deepak Bhagat
15.7 Creating a New Page with Template -o
(Dependent on 14.4)
BAT
BAT BAT
222/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
BAT
BAT
BAT
bat BAT
BAT
223/454
ADF Essentials Training by Deepak Bhagat
15.8 Adding Panel Springboard Component -o
(Valid only on ADF/JDeveloper 12c)
BAT
BAT
BAT
BAT
7) Save All.
8) Run the BATSpringboard.jsf page and test the Panel Spring Board layout.
224/454
ADF Essentials Training by Deepak Bhagat
9) Click on Loc-Depts and Quick Search and test.
BAT
BAT BAT
225/454
ADF Essentials Training by Deepak Bhagat
15.9 Converting JSPX to Facelets -o
BAT
BAT BAT
226/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
BAT
BAT
BAT
BAT
BAT
b) Ensure the Change Page Extensions to is selected as .jsf, click Preview in Log.
c) In the Log window, click Convert (Observe .jspx changes to .jsf.).
227/454
ADF Essentials Training by Deepak Bhagat
BAT
228/454
ADF Essentials Training by Deepak Bhagat
15.10 Refactoring Page and Page Definition File -o
1) Show all references in page, page definition and data binding files.
2) Right-click the BAT_JSPX_Page > Refactor > select Rename.
BAT
BAT
BAT
BAT
BAT
BAT
BAT
BAT
BAT
BAT
229/454
ADF Essentials Training by Deepak Bhagat
6) To open pageDef file, right-click in the editor and select Go to Page Definition from
context menu.
BAT
bat
bat
BAT
BAT
BAT
BAT
BAT
230/454
ADF Essentials Training by Deepak Bhagat
15.11 Lab Solution
231/454
ADF Essentials Training by Deepak Bhagat
15.12 Bind Custom Declarative Components to ADF -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L15-ADFXtEg-Reusability\.
This example demonstrates binding of custom declarative components to ADF.
232/454
ADF Essentials Training by Deepak Bhagat
16
Working with Parameters,
Scopes and Partial Page Refresh
(PSP)
In this lab, you open the already existed application and explore set action listeners, scopes and
parameters. You also explore different types of parameters and partial page refresh.
233/454
ADF Essentials Training by Deepak Bhagat
16.1 Copying BATLab_16-PSP from Solution -o
Lab Agenda:
BAT
234/454
ADF Essentials Training by Deepak Bhagat
16.2 Implementing Set Action Listener, Scopes and Partial Page Refresh -o
Using Set Action Listener, Scopes and Partial Page Refresh (Explore Solution) -o
BAT
BAT
235/454
ADF Essentials Training by Deepak Bhagat
16.3 Setting Conditional Display -o
236/454
ADF Essentials Training by Deepak Bhagat
237/454
ADF Essentials Training by Deepak Bhagat
16.4 Defining Task Flow Parameters -o
238/454
ADF Essentials Training by Deepak Bhagat
16.5 Defining Regions Parameters -o
1) Run the BAT_PSP_Index.jsf. Observe parameter passing from parent jsf page to its two
regions ‘Location Department Page’ and ‘Employee List’.
2) Explore the parameter passing to regions in BAT_PSP_IndexPageDef.xml.
BAT
bat
bat
bat
239/454
ADF Essentials Training by Deepak Bhagat
16.6 Using Refresh Property in PageDef -o
240/454
ADF Essentials Training by Deepak Bhagat
16.7 Lab Solution
bat
bat
BAT
241/454
ADF Essentials Training by Deepak Bhagat
17
Responding to Managed Beans,
Events and Listeners
In this lab, you create managed beans, events and listeners.
242/454
ADF Essentials Training by Deepak Bhagat
17.1 Creating new Application BATLab_17 with ViewController Project -*
Create a new application BATLab_17 with default projects, with default packages and settings.
1) Create an application named BATLab_17 with package bat and with default projects,
packages and settings.
a) Click the File menu > New > select Application.
New Gallery wizard appears.
b) Expand the General > Applications > select ADF Fusion Web Application.
c) Click OK.
Create ADF Fusion Web Application wizard appears.
BAT
BAT BAT
bat
243/454
ADF Essentials Training by Deepak Bhagat
BAT
b) Choose the relevant option and click Yes button. Click Yes again. Save All.
4) Close the JDeveloper.
5) Under the …\BATLab_17\ folder, delete Model folder.
BAT
244/454
ADF Essentials Training by Deepak Bhagat
17.2 Creating Managed Bean -*
1) Create the new JSF page named BATIndex.jsf. (Refer 12.2 lab, to create a JSF page.)
2) Add the Panel Group Layout to the page.
a) In the Structure window, select af:panelGroupLayout,
b) In the Properties window, in Layout property, select scroll.
3) Add the Input Text to the Panel Group Layout.
a) In the Structure window, select af:inputText,
b) In the Properties window, in Label property, enter Input.
4) Add the Button to the Panel Group Layout.
a) In the Structure window, select af:button,
b) In the Properties window, in Text property, enter Submit.
5) Add the Output Text to the Panel Group Layout.
a) In the Structure window, select af:outputText,
b) In the Properties window, in Text property, enter Output.
6) Save All.
BAT
BAT
7) Bind the inputText and outputText components and their values to a new backing bean.
a) In the Structure window, select af:inputText-Input,
b) In the Property window, in Value property click icon, select Expression Builder
(from the context menu).
245/454
ADF Essentials Training by Deepak Bhagat
c) Select the ADF Managed Beans, click Create Managed Bean.
Create Managed Bean window appears.
bat
BAT
bat
246/454
ADF Essentials Training by Deepak Bhagat
bat
bat
bat
247/454
ADF Essentials Training by Deepak Bhagat
bat
BAT BAT
BAT
bat
bat
248/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
BAT
BAT
BAT
BAT
BAT
BAT
249/454
ADF Essentials Training by Deepak Bhagat
d) Click New next to the Property, in Create Property dialog box, in the Property
Name field, enter lifecycleBean. Click OK. Click OK. Save All.
9) Verify newly created Managed Bean BATBackingBean.java.
10) Verify registration of backing bean in adfc-config.xml.
11) Select the outputText and assign PartialTriggers property against button-b1 and
inputText-t1.
12) Select the inputText and in the AutoSubmit property, select true.
13) Run the BATIndex.
bat BAT
250/454
ADF Essentials Training by Deepak Bhagat
17.3 Creating Action Listener and Adding Method Binding -*
(Dependent on 16.1)
Create Action Listener.
BAT
BAT
251/454
ADF Essentials Training by Deepak Bhagat
17.4 Creating Value Change Listener -*
(Dependent on 16.1)
BAT
BAT
252/454
ADF Essentials Training by Deepak Bhagat
17.5 Adding Phase Listener -o
BAT
BAT
253/454
ADF Essentials Training by Deepak Bhagat
BAT BAT
bat BAT
254/454
ADF Essentials Training by Deepak Bhagat
17.6 Adding Validator -o
Add Validator.
}
5) Register the bat.view.BATValidator in faces-config.xml.
6) Assign the batValidator to inputText in BATIndex.jsf.
7) Run the BATIndex.
BAT
BAT
BAT
255/454
ADF Essentials Training by Deepak Bhagat
17.7 Adding Converter -o
Add Converter.
BAT
256/454
ADF Essentials Training by Deepak Bhagat
17.8 Lab Solution
257/454
ADF Essentials Training by Deepak Bhagat
18
Binding Model Layer with
Business Services and
Databound View
In this lab, you bind the model layer with business services by using table, form and tree
components. You also use graph component and setCurrentRowWithKey,
setCurrentRowWithKeyValue properties.
258/454
ADF Essentials Training by Deepak Bhagat
18.1 Copying Application -o
Make a copy of application BATLab_15 and rename it to BATLab_18. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
259/454
ADF Essentials Training by Deepak Bhagat
18.2 Creating a Read Only ADF Tables with Row Selection -*
(Dependent on 14)
BAT
BAT
BAT
BAT
BAT
260/454
ADF Essentials Training by Deepak Bhagat
a) Select Single Row,
b) Check all check boxes,
c) Click OK.
3) Expand the Departments1, drag Employees3 to the panelCollection > select ADF
Table (from context menu).
BAT
BAT
BAT
BAT
BAT
261/454
ADF Essentials Training by Deepak Bhagat
Create Table window appears.
262/454
ADF Essentials Training by Deepak Bhagat
6) Run the BATIndex.jsf page and test the tables.
BAT
BAT BAT
263/454
ADF Essentials Training by Deepak Bhagat
18.3 Customizing Data and UI Components -o
(Dependent on 14.4, 18.2)
Customize the data and UI components such as table properties and convert columns to links etc.
264/454
ADF Essentials Training by Deepak Bhagat
c) Select the Link and click OK. Click OK.
d) Select the af:link, in the Properties window, in the Text field enter
#{row.DepartmentName}.
4) Add the showPopupBehavior property to link.
a) Right-click the af:link-#{…DepartmenName} > Insert Inside Link > select ADF
Faces.
Insert ADF Faces Item window appears.
b) Select the Show Popup Behavior, click OK.
Insert Show Popup Behavior dialog box appears.
265/454
ADF Essentials Training by Deepak Bhagat
BAT
d) In the ExportedId field, enter t2 (id of Employees’ table) and in the Type field,
ensure excelHTML. Click OK.
BAT
11) Comment out two existing links in department and employee boxes (i.e. Department Name
& Detail).
12) Save All.
13) Run the BATIndex.jsf page and test the links and other changes.
268/454
ADF Essentials Training by Deepak Bhagat
BAT
269/454
ADF Essentials Training by Deepak Bhagat
18.4 Creating a Detail Forms -o
BAT
BAT
BAT
BAT
BAT
3) Check Read-Only Form check box. Leave other check boxes as it is. Click OK.
270/454
ADF Essentials Training by Deepak Bhagat
4) Select the af:panelFormLayout, in the Properties window, in Rows field enter 6.
5) Save All.
6) Run the page and test the detail form.
a) Run the BATIndex page.
b) Click the EmployeeId (e.g. 200). It shows Employee Detail form.
c) Click the Done button to navigate back.
271/454
ADF Essentials Training by Deepak Bhagat
18.5 Making a Table Non-Selectable -o
272/454
ADF Essentials Training by Deepak Bhagat
BAT
273/454
ADF Essentials Training by Deepak Bhagat
18.6 Using setCurrentRowWithKey -o
(Dependent on 18.7)
1) In the Data Controls window, expand Departments1 > Employees3 > Operations >
drag setCurrentRowWithKey to af:link-#{…EmployeeId} (in Structure window).
BAT
3) Check text and action check boxes to retain their values. Click OK.
4) Open the EmpListPFPageDef in the editor.
274/454
ADF Essentials Training by Deepak Bhagat
5) Click the Source tab (at the bottom), select setCurrentRowWithKey (i.e. <NamedData
NDName=”rowKey”..), in the Properties window, in NDValue property, enter
#{row.rowKeyStr}
6) Save All.
bat
275/454
ADF Essentials Training by Deepak Bhagat
BAT
276/454
ADF Essentials Training by Deepak Bhagat
18.7 Using setCurrentRowWithKeyValue -o
(Dependent on 18.7)
277/454
ADF Essentials Training by Deepak Bhagat
4) Check text and action check boxes to retain their values. Click OK.
5) Open the EmpListPFPageDef in the editor.
6) Click the Source tab (at the bottom), select setCurrentRowWithKeyValue (i.e.
<NamedData NDName=”rowKey”..), in the Properties window, in NDValue property,
enter #{row.EmployeeId}.
7) Save All.
8) Run the page and explore Employees table.
a) Run the BATIndex page
b) Now select LastName from any row then it shows that particular Employee Detail
record only. Not the first record.
278/454
ADF Essentials Training by Deepak Bhagat
BAT
279/454
ADF Essentials Training by Deepak Bhagat
18.8 Creating a Graph Component -o
(Dependent on 14.5)
Add a graph component to the page i.e. Pie Chart for Salary.
280/454
ADF Essentials Training by Deepak Bhagat
6) Add the PartialTrigger to point to DepartmentName column link i.e. ::t1::ot2.
a) Select the af:link-#{…DepartmentName}, in the Properties window,
i) In the PartialTriggers field, click icon next to it and select Edit from the drop-
down.
281/454
ADF Essentials Training by Deepak Bhagat
ii) Select the link-ot3 from Available pane and shuttle it to Selected pane. Click
OK.
7) In the Structure window. Select the af:popup, in the Properties window, in the
ConentDelivery property, select lazyUncached.
8) Save All.
9) Run the page and test the graph component.
a) Run the BATIndex page.
b) Click the DepartmentName link.
c) It shows Popup with Salary Graph.
282/454
ADF Essentials Training by Deepak Bhagat
18.9 Creating a Read Only Tree -o
BAT
BAT
283/454
ADF Essentials Training by Deepak Bhagat
3) In the Root Data Source field, ensure AppModuleAMDataControl.Locations1 is
selected.
4) In the Tree Level Rules section, click icon and select Departments.
5) Select the 1st level in tree i.e. bat.model.vo.LocationsVO(<Departments>).
6) Select the City from Available Attributes and shuttle it to Display Attributes (in the
bottom of the wizard).
bat
bat
284/454
ADF Essentials Training by Deepak Bhagat
bat
bat
285/454
ADF Essentials Training by Deepak Bhagat
BAT
286/454
ADF Essentials Training by Deepak Bhagat
18.10 Lab Solution
287/454
ADF Essentials Training by Deepak Bhagat
18.11 More ADF Data-bound Components -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L18-ADFXtEg-DataboundComp\.
These examples demonstrate Thematic map, Master-Details more details and various features on
Tree component.
288/454
ADF Essentials Training by Deepak Bhagat
19
Querying Data with Search
Components
In this lab, you add quick search component to search employee results.
289/454
ADF Essentials Training by Deepak Bhagat
19.1 Copying Application -o
Make a copy of application BATLab_18 and rename it to BATLab_19. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
290/454
ADF Essentials Training by Deepak Bhagat
19.2 Adding Query Search and Result -*
(Dependent on 6.6)
Add Query Search and Result components to search the employee results by providing any
attribute value.
BAT
3) Drag the EmpSummary1 to panelCollection and select ADF Table from context menu.
291/454
ADF Essentials Training by Deepak Bhagat
BAT
4) Select Single Row and check Sorting and Read-Only Table check boxes.
5) Reorder the columns by using arrows like: EmployeeId, FirstName, LastName,
Email, Salary, AnnualSalary, HireDate, JobId, ManagerId, DepartmentId and
remove CommissionPct. Click OK.
292/454
ADF Essentials Training by Deepak Bhagat
6) In the Structure window, move the toolbar (with Create and Update buttons) from
panelHeader to toolbar of panelCollection.
293/454
ADF Essentials Training by Deepak Bhagat
7) Select the af:query under panelHeader-EmployeesEO.
8) In the Properties window, in ResultComponentId field, enter ::pc1:t2 (table-t2 value
in Panel Collection).
9) Save All.
10) Run the BATIndex page and test query search functionality.
a) Click the Employee Search tab.
b) In the EmployeeId field, enter 100.
c) Click Search button or Enter key.
d) Observe the result in below table.
294/454
ADF Essentials Training by Deepak Bhagat
19.3 Customizing Query Search and Result -o
(Dependent on 18.3)
1) Select the af:query and in the Properties window, in Rows property enter 6 and in
MaxColumns property enter 3.
2) Select the af:panelCollection and in the Properties window, in the StyleClass
property enter AFStretchWidth.
3) Select the af:table-t2 and in the Properties window, in ColumnStrectching property
select blank and in AutoHeightRows property enter 5.
4) Save All.
5) Run the BATIndex page and test the customized changes.
295/454
ADF Essentials Training by Deepak Bhagat
19.4 Adding Quick Search -o
(Dependent on 7.5)
Add the Quick Search component to search to employee details by providing email in search box.
BAT
296/454
ADF Essentials Training by Deepak Bhagat
6) In the Properties window, in Label field change to Email.
7) Select the af:button-ExecuteWithParams, in the Properties window, in Text field
change to Search.
8) In the Data Controls window, drag EmpByEmail1 to af:panelGroupLayout and select
ADF Form from context menu.
297/454
ADF Essentials Training by Deepak Bhagat
298/454
ADF Essentials Training by Deepak Bhagat
19.5 Lab Solution
299/454
ADF Essentials Training by Deepak Bhagat
20
Implementing Transactions
In this lab, you complete the application by adding transaction management. So far, the
application navigates to all the pages and displays data, but the commit functions are missing.
300/454
ADF Essentials Training by Deepak Bhagat
20.1 Copying Application -o
Make a copy of application BATLab_18 and rename it to BATLab_19. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
301/454
ADF Essentials Training by Deepak Bhagat
20.2 Implementing Create Operation -*
(Dependent on 5.6 and 12)
BAT
BAT
BAT
302/454
ADF Essentials Training by Deepak Bhagat
3) Do not check any check box, remove columns DepartmentId, DepartmentName,
ManagerId. Click OK.
4) Select the panelFormLayout. In the Properties window, in Rows property, enter 5.
5) In the Data Controls window, expand EmpSummary1 > Operations > drag
CreateInsert to af:toolbar > select ADF Button (from context menu).
303/454
ADF Essentials Training by Deepak Bhagat
BAT
6) Expand the Operations (under Locations1), drag Rollback to af:toolbar, select ADF
Button (from context menu).
304/454
ADF Essentials Training by Deepak Bhagat
BAT
7) Drag the Commit onto Save button. Check text to retain. Click OK. Save All.
305/454
ADF Essentials Training by Deepak Bhagat
BAT
306/454
ADF Essentials Training by Deepak Bhagat
10) Navigate back to EmpCreatePF page.
a) In the Components window, drag Auto Suggest Behavior to JobId attribute.
b) In the Structure window, select af:autoSuggestBehavior under JobId, in the
Properties window, in SuggestedItems property enter
#{bindings.JobId.suggestedItems}.
307/454
ADF Essentials Training by Deepak Bhagat
11) Drag the CreateInsert as Method Activity to EmpCreateTF task flow and mark it as Default
Activity.
a) Open the EmpCreateTF.xml in the editor.
b) In the Data Controls window, expand EmpSummary1 > Operations > drag
CreateInsert to editor.
c) Select the CreateInsert activity and mark it to Default Activity (click on top of
the editor).
d) Add the Control Flow Case component from CreateInsert to EmpCreatePF, leave
name default.
e) Save All.
12) Run the page and see the importance of Immediate property and Commit required.
Compare data in DB.
13) Add the immediate property to Create button.
308/454
ADF Essentials Training by Deepak Bhagat
a) Open the EmpCreatePF page in the editor.
b) Select the Cancel button, in the Properties window, in Immediate property, select
true.
14) Add the commit and rollback properties to Save and Cancel return activities in task flow to
enhance transaction property.
a) Open the EmpCreateTF in the editor, click somewhere in the editor.
b) In the Properties window, in Transaction property, select Use Existing
Transaction if Possible.
c) Select the Save return activity, in Properties window, in End Transaction property
select commit.
d) Select the Cancel return activity, in Properties window, in End Transaction
property select rollback.
15) Run the BATIndex page and test Create operation.
a) Click the Create button.
b) In the Employee Create page, create a new record.
309/454
ADF Essentials Training by Deepak Bhagat
20.3 Implementing Delete Operation and Creating Helper Method -*
BAT
3) Save All.
4) Run the BATIndex page and test.
5) Select the af:button-Delete, in the Properties window, in Disabled property select
false, in PartialTrigger property enter/add (b3) (itself).
6) Save All. Rebuild jsff page and refresh browser url.
310/454
ADF Essentials Training by Deepak Bhagat
7) Compare the data with DB.
8) In the Data Controls window, expand Operations > drag Commit operation to Panel
Collections af:toolbar > select ADF Button from context menu.
312/454
ADF Essentials Training by Deepak Bhagat
20.4 Implementing Update Operation -o
(Dependent on 5.6 and 14.7)
313/454
ADF Essentials Training by Deepak Bhagat
2) Open the EmpUpdateJobPF in the editor.
a) Drag the EmpSummarry1 to Content of pageTemplate (in Structure window),
select ADF Form from context menu.
Create Form window appears.
314/454
ADF Essentials Training by Deepak Bhagat
b) Select the Save return activity, in the Properties window, in End Transaction
property, select commit.
c) Select the Cancel return activity, in the Properties window, in End Transaction
property, select rollback.
d) Save All.
5) Run the BATIndex page and test the transaction functionality.
315/454
ADF Essentials Training by Deepak Bhagat
20.5 Lab Solution
316/454
ADF Essentials Training by Deepak Bhagat
20.6 More ADF Transaction Management -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L20-ADFXtEg-TrxnMgmnt\.
These examples demonstrate various other transaction management.
317/454
ADF Essentials Training by Deepak Bhagat
21
Understanding Data Controls
and Bindings
No Lab.
318/454
ADF Essentials Training by Deepak Bhagat
21.1 Examining the Page’s Data Bindings -*
(Dependent on 14)
Examine the data bindings that JDeveloper automatically created on the page when you dragged
a data control to the page.
BAT
BAT
3) For example, select the first column in the upper table in the JDeveloper editor, and then
look at the Property Inspector. What is the Header Text property set to?
Answer: #{bindings.Departments1.hints.DepartmentId.tooltip}.
4) Select the DepartmentName output text under the column header. What is its value?
Answer: #{row.DepartmentName}.
5) The reference to row is to a variable that is defined on the table.
6) Select the table in the Structure window, and then click the Source tab in the editor. How
is the row variable defined?
Answer: var="row"
value="#{bindings.Departments1.collectionModel}".
7) At run time, what appears in the browser for the first column’s heading?
Answer: The column heading is DepartmentId.
8) In JDeveloper, in the Model project of lab 9, open the DepartmentsEO entity object and
edit the DepartmentName attribute. Where does the Last Name label in the UI come from?
Answer: Last Name comes from the entity object attribute’s control hints for Label.
9) At run time, what appears in the browser for the first column’s values? Where do these
values come from?
Answer: 10, 20 and 30 are the department Id in the rowset; they are the input values
for the department Id in the rows.
319/454
ADF Essentials Training by Deepak Bhagat
10) In the Application Navigator, right-click the page and select Go to Page Definition. What
is the name of the page definition file? (You can also view data bindings by clicking the
Bindings tab of the page itself.)
Answer: EmplListPFPageDef.xml.
11) In the Model section of the page definition file, trace the source of the Departments1
binding. Where does the data come from?
12) Answer: The data comes from the Departments1 view object instance in the
AppModuleAMDataControl. The data is held in the entity object on which the
DepartmentsEO view object is based, and the values ultimately come from the database.
13) At the top of the page, click the link to the Data Binding Registry. What is the name of this
file?
Answer: DataBindings.cpx.
14) When does this data binding registry file get created? Hint: The answer is right at the top
of the Overview page for the data binding registry file.
Answer: The file is created the first time that you bind a UI component to data in the
application.
15) What does the Page Mappings section of this file show?
Answer: It shows the mapping of pages to the IDs of their associated page definition files.
16) What does the Page Definition Usages of this file show?
Answer: It shows the mapping of page definition file IDs to paths of their page definition
files.
17) What does the Data Control Usages section of this file show?
Answer: It shows the data controls that are used in the application.
18) Close the browser and the files that you have open in the JDeveloper editor. As you add
pages to the application, you can re-examine the data-binding registry to see how page
mappings, page definition usages, and data control usages are shown for the additional
pages.
320/454
ADF Essentials Training by Deepak Bhagat
22
Programmatically Customizing
Business Services
In this lab, you add programmatic functionality to your business components.
321/454
ADF Essentials Training by Deepak Bhagat
22.1 Copying Application -*
Make a copy of application BATLab_20 and rename it to BATLab_22. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
322/454
ADF Essentials Training by Deepak Bhagat
22.2 Migrating Project to Another Application -*
Remove existing Model.jar and migrate Model project from BATLab_09 to BATLab_22.
b) Select the Libraries and Classpath > ADF Library and click Edit.
Edit Library Definition window appears.
323/454
ADF Essentials Training by Deepak Bhagat
BAT
c) Select the path ..\Model.jar and click Remove > Yes > OK.
d) In the Project Properties wizard, select ADF Library and click Remove. Click OK.
2) Copy the Model folder from BATLab_09 and paste it to BATLab_22.
3) In the JDeveloper, click Open folder and select …\BATLab_22\Model\Model.jpr.
4) Click the Build menu > Clean All and Refresh Application > Yes.
5) Click the Save All.
324/454
ADF Essentials Training by Deepak Bhagat
22.3 Prog Custz EO: Including Override Method -*
3) Ensure the following options are checked: Accessors, Data Manipulation Methods,
Create Method and Remove Method.
4) Open the EmployeesEOImpl.java.
5) Observe all accessors and three overridden methods generated.
6) Add the sop (i.e. System.out.println) and copy three overridden methods from the
solution.
protected void create(AttributeList attributeList) {
System.out.println(" In EmployeesEOImpl.create().");
super.create(attributeList);
}
public void remove() {
System.out.println(" In EmployeesEOImpl.remove().");
super.remove();
}
protected void doDML(int operation, TransactionEvent e) {
System.out.println(" BEGIN: EmployeesEOImpl.doDML().");
if (operation == DML_INSERT) {
System.out.println(" DML_INSERT operation
executed.");
}
if (operation == DML_UPDATE) {
System.out.println(" DML_UPDATE operation
executed.");
325/454
ADF Essentials Training by Deepak Bhagat
}
if (operation == DML_DELETE) {
System.out.println(" DML_DELETE operation
executed.");
}
System.out.println(" END: EmployeesEOImpl.doDML().");
super.doDML(operation, e);
}
7) Right-click in the editor and click Make.
8) Save All.
326/454
ADF Essentials Training by Deepak Bhagat
22.4 Prog Custz EO: Overriding Method -*
327/454
ADF Essentials Training by Deepak Bhagat
bat
3) In the Search box, enter init.. and check initDefaults():void. Click OK.
4) Save and Make.
328/454
ADF Essentials Training by Deepak Bhagat
22.5 Programmatically Assigning a Database Sequence -*
329/454
ADF Essentials Training by Deepak Bhagat
22.6 Prog Custz AM: Adding and Exposing Service Methods -*
bat
d) Select these methods from Available pane and shuttle them to Selected pane, click
OK.
e) Observe the Client Interface section with added service methods.
331/454
ADF Essentials Training by Deepak Bhagat
6) Again, expand the AppModuleAMDataControl. Observe that data models and client
interface methods are exposed.
332/454
ADF Essentials Training by Deepak Bhagat
8) Double-click the DeptLocVL1 and navigate through rows by clicking Next & Previous
icons. Now verify that only those Locations with Departments are displayed. Locations with
no Department are NOT displayed.
333/454
ADF Essentials Training by Deepak Bhagat
22.7 Prog Custz VO: Default Parameterized Where Clause -*
Programmatically customize view object such as Sorting and Selection: Default Parameterized
Where Clause
334/454
ADF Essentials Training by Deepak Bhagat
22.8 Prog Custz VO: Default Parameterized View Criteria -o
Programmatically customize view object such as Sorting and Selection: Default Parameterized
View Criteria.
335/454
ADF Essentials Training by Deepak Bhagat
22.9 Prog Custz VO: Dynamic Parameterized Where Clause -o
Programmatically customize view object such as Sorting and Selection: Dynamic Parameterized
Where Clause.
336/454
ADF Essentials Training by Deepak Bhagat
22.10 Prog Custz VO: Dynamic Parameterized View Criteria -o
Programmatically customize view object such as Sorting and Selection: Dynamic Parameterized
View Criteria.
337/454
ADF Essentials Training by Deepak Bhagat
22.11 Prog Custz VO: Resetting -o
338/454
ADF Essentials Training by Deepak Bhagat
22.12 Prog Custz VO: CRUD Operation: Creating -o
339/454
ADF Essentials Training by Deepak Bhagat
22.13 Prog Custz VO: CRUD Operation: Reading and findByPrimaryKey -o
Programmatically customize view object such as CRUD Operation: Reading and findByPrimaryKey.
bat
340/454
ADF Essentials Training by Deepak Bhagat
22.14 Prog Custz VO: CRUD Operation: Deleting and findByKey -o
Programmatic customization view object such as CRUD Operation: Deleting and findByKey.
341/454
ADF Essentials Training by Deepak Bhagat
22.15 Testing Exposed Service Methods using ADF Model Tester -o
Test all the above service methods using ADF Model Tester.
342/454
ADF Essentials Training by Deepak Bhagat
22.16 Creating and Running Test Clients -o
1) Create the test client class BATBusinessServiceCallTC to call business service client
interface.
a) Right-click the bat.model > New > From Gallery.
New Gallery wizard appears.
343/454
ADF Essentials Training by Deepak Bhagat
BAT
bat
344/454
ADF Essentials Training by Deepak Bhagat
22.17 Calling Service Method from MVC Layer -o
1) Create the new task flow named EmpFilterTF and a new view activity named
EmpFilterPF.
2) Drag and drop following service methods from Data Control with ND Value, as shown below.
Client Interface ND Value
applyVC_EmpByDeptId(Integer); #{pageFlowScope.deptId}
defineDynamicWC_EmpBySalary(Integer); #{pageFlowScope.salary}
defineDynamicVC_EmpBySalary(Integer); #{pageFlowScope.salary}
3) Also add the Router name salFilterRouter to task flow EmpFilterTF.
4) Add the following control flows from page to router and methods.
345/454
ADF Essentials Training by Deepak Bhagat
BAT
346/454
ADF Essentials Training by Deepak Bhagat
347/454
ADF Essentials Training by Deepak Bhagat
22.18 Lab Solution
348/454
ADF Essentials Training by Deepak Bhagat
23
Deploying ADF Applications
In this lab, you create a deployment profile and configure deployment options for the application
that you have developed. You then configure a data source in the stand-alone Oracle WebLogic
Server, and you configure the application to use a data source. Finally, you deploy the application
to the stand-alone Oracle WebLogic Server, and you test the deployment.
349/454
ADF Essentials Training by Deepak Bhagat
23.1 Copying Application -o
Make a copy of application BATLab_22 and rename it to BATLab_23. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
350/454
ADF Essentials Training by Deepak Bhagat
23.2 Creating a Business Service Deployment Profile -*
BAT
BAT
BAT
BAT
BAT
BAT
f) Select the Deployment (at left-side pane) > expand BATModel (Business
Components Archive) (at right-side pane).
g) Select the BATModel_Common (JAR Module) and click Edit.
351/454
ADF Essentials Training by Deepak Bhagat
Edit JAR Deployment Profile Properties wizard appears.
BAT BAT
352/454
ADF Essentials Training by Deepak Bhagat
23.3 Creating a Web Module Deployment Profile -*
BAT
BAT BAT
BAT
BAT
353/454
ADF Essentials Training by Deepak Bhagat
e) Select the Specify Java EE Web Context Root radio-button and enter BATLab in
the text box. Click OK.
f) Save All.
g) To edit the Deployment Profile, right-click the ViewController > select Project
Properties.
Project Properties wizard appears.
BAT BAT
BAT
BAT
h) Select the Deployment (at left-side pane) > BATWeb (Web Module) (at right-side
pane) and click Edit.
i) Enter Specify Java EE Web Context Root as BATLab. Modify WAR File as
…\mywork\deploy\BATWeb.war
j) Right-click the ViewController > Deploy > select BATWeb.
Deploy BATWeb wizard appears.
BAT
354/454
ADF Essentials Training by Deepak Bhagat
23.4 Creating an Application Deployment Profile -*
BAT
BAT BAT
BAT
355/454
ADF Essentials Training by Deepak Bhagat
BAT BAT
BAT
BAT
BAT
BAT
BAT
BAT
f) Expand the Model.jpr, check BATModel and expand ViewController.jpr, check BATWeb.
Click OK.
g) Save All.
h) Select Application > Project Properties > Deployment > BATLab (Application
Module), click Edit.
i) Enter EAR file as …\mywork\deploy\BATLab.ear. In Application Assembly. Check
BATModel & BATWeb.
j) Click the Application menu > Deploy > select BATLab.
Deploy BATLab wizard appears.
356/454
ADF Essentials Training by Deepak Bhagat
l) Save All.
357/454
ADF Essentials Training by Deepak Bhagat
23.5 Starting Integrated Weblogic Server -*
1) Click the Run menu > select Start Server Instance (IntegratedWebLogicServer).
358/454
ADF Essentials Training by Deepak Bhagat
23.6 Deploying the Application from JDeveloper -*
BAT
BAT BAT
BAT
359/454
ADF Essentials Training by Deepak Bhagat
23.7 Running the Application -*
360/454
ADF Essentials Training by Deepak Bhagat
23.8 Undeploying the Application -*
361/454
ADF Essentials Training by Deepak Bhagat
3) Click the Deployments (at left-side panel).
4) It displays all deployed files in the server.
BAT
BAT
362/454
ADF Essentials Training by Deepak Bhagat
Application Servers window opens at left-side.
BAT
BAT
363/454
ADF Essentials Training by Deepak Bhagat
23.9 Lab Solution
364/454
ADF Essentials Training by Deepak Bhagat
24
Securing ADF Applications
In this lab, you set up the application to use security. You create users and you assign permissions
to roles. You also create login. You then use ADF security to manage access to pages, task flows,
and entity objects.
365/454
ADF Essentials Training by Deepak Bhagat
24.1 Copying Application -o
Make a copy of application BATLab_23 and rename it to BATLab_24. Follow the steps, as
explained in Lab 5.1 or Lab 6.1.
366/454
ADF Essentials Training by Deepak Bhagat
24.2 Configuring the Application to use ADF Security -o
1) Expand the Application Resources window > Descriptors node and examine existing
files.
2) Select the ViewController project. Click the Application menu > Secure > select
Configure ADF Security.
BAT
bat
bat
bat
bat
bat
bat
bat
367/454
ADF Essentials Training by Deepak Bhagat
BAT
368/454
ADF Essentials Training by Deepak Bhagat
24.3 Defining Users in the Identity Store -o
369/454
ADF Essentials Training by Deepak Bhagat
24.4 Defining Application Roles -o
370/454
ADF Essentials Training by Deepak Bhagat
b) Check the Admin checkbox and click OK.
c) Select the Employee (Emp-Role), click icon, select Add User.
d) In the Select User window, check Deepak checkbox. Click OK. Save All.
371/454
ADF Essentials Training by Deepak Bhagat
24.5 Implementing Security on Task Flows and Pages -o
1) To Create and Update web pages and task flows, grant only Admin-Role. To all web pages
and task flows, grant both Admin-Role and Employee-Role.
a) Click the Resource Grants page,
i) In the Resource Type field, select Task Flow from the drop-down,
ii) Ensure the Source Project field is selected ViewController by clicking
magnifier icon.
iii) Select any task flow in Resources section. In Granted To section, click icon >
select Add Application Role.
372/454
ADF Essentials Training by Deepak Bhagat
b) Now in the Resource Type field, select Web Page and assign required permissions.
2) Do the same process for User role. Save All.
BAT bat
BAT
BAT bat
BAT bat
bat
bat
bat
bat
bat
bat
bat
bat
bat
373/454
ADF Essentials Training by Deepak Bhagat
24.6 Testing Application Authentication and Authorization -o
BAT BAT
374/454
ADF Essentials Training by Deepak Bhagat
24.7 Lab Solution
375/454
ADF Essentials Training by Deepak Bhagat
24.8 ADF Basic Authentication -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L24-ADFXtEg-Security\.
This example demonstrates basic ADF Security.
376/454
ADF Essentials Training by Deepak Bhagat
25
Debugging and Troubleshooting
ADF Applications
Most of the techniques for troubleshooting are used mainly for debugging a user interface.
However, you can run the JDeveloper Debugger with the Business Components Browser, which
enables you to troubleshoot problems with your ADF BC model apart from running a Fusion Web
application. In the practices for this lesson, you debug a client method in an application module,
and you explore the features of the JDeveloper Debugger.
377/454
ADF Essentials Training by Deepak Bhagat
25.1 Copying Solution -*
378/454
ADF Essentials Training by Deepak Bhagat
25.2 Discovering Application Problems -*
379/454
ADF Essentials Training by Deepak Bhagat
25.3 Setting Breakpoints in the Debugger -*
380/454
ADF Essentials Training by Deepak Bhagat
bat
bat
381/454
ADF Essentials Training by Deepak Bhagat
bat
bat
b) Right-click the Breakpoints window to see options that are available in context menu.
382/454
ADF Essentials Training by Deepak Bhagat
25.4 Running Application Module in Debug Mode -*
bat
bat
bat
383/454
ADF Essentials Training by Deepak Bhagat
d) Observe the Data tab, expand +this, dEmail is null.
e) Observe the Smart Data tab, dEmail appears on its own.
385/454
ADF Essentials Training by Deepak Bhagat
m) Click Step Out and then Step Over.
i) Observe the Watches tab.
ii) Method debugEmail is AKHOO.
386/454
ADF Essentials Training by Deepak Bhagat
o) Click Step Over (2 times) till we cross or step over line executeQuery().
i) Again, in Smart Data tab, expand and observe the value under employeeVO >
mViewRowSet > mWhereParams > [0]. It is AKHOO.
387/454
ADF Essentials Training by Deepak Bhagat
a) Return value displays Alexander Khoo.
3) Double-click the EmployeeByEmail1.
Bind Variable dialog box appears.
4) Click Cancel button, so that value set by executeWhereClause_EmpByEmail()
method is used. Correct record appears with values.
388/454
ADF Essentials Training by Deepak Bhagat
389/454
ADF Essentials Training by Deepak Bhagat
26
Best Practices
390/454
ADF Essentials Training by Deepak Bhagat
27
Miscellaneous Topics
391/454
ADF Essentials Training by Deepak Bhagat
27.1 Real-time End-to-end ADF Application -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L27-ADFXtEg-Miscellaneous\.
These examples demonstrate real-time independent end-to-end ADF Application.
392/454
ADF Essentials Training by Deepak Bhagat
28
Advance Topics
393/454
ADF Essentials Training by Deepak Bhagat
28.1 UI and Page Flow Design
394/454
ADF Essentials Training by Deepak Bhagat
28.2 List of Existing Features
This real-time application consists of every ADF functionality implemented from Lab 3 to Lab 19
and some of Lab 21. So existing functionality can be explored in similar way as Lab 3 to Lab 21.
Implementation of few minor functionalities from Lab 3 to Lab 21 may be missing in this advance
ADF. There is implementation of additional advance functionalities as listed below. Explore,
understand and practice advance functionalities.
Observe that this lab solution has difference in file and package naming standard.
395/454
ADF Essentials Training by Deepak Bhagat
28.3 Adding Custom View Criteria
396/454
ADF Essentials Training by Deepak Bhagat
28.4 Traversing, Creating and Deleting Master-Detail
397/454
ADF Essentials Training by Deepak Bhagat
28.5 Creating an Application Module Base Class
398/454
ADF Essentials Training by Deepak Bhagat
28.6 Programmatically Calling EL, Scopes and Conditional Display
Call EL, scopes and conditional display programmatically - PGViewController (Extn to Lab 16).
1) Run the PlaygroundIndex.jsf and play around with all buttons and links and observe
various behavior.
2) Open the PGEmpListPF.jsff and PGEmpListBean.java pages in the editor.
3) Explore the changeScopeValues() method.
399/454
ADF Essentials Training by Deepak Bhagat
28.7 Adding Router Activity
400/454
ADF Essentials Training by Deepak Bhagat
28.8 Programmatically Handling Confirm Dialog
Handle dialog box (with Yes or No) programmatically - HRViewController (Extn to Lab 14.5).
401/454
ADF Essentials Training by Deepak Bhagat
28.9 Programmatically Invoking Popup
402/454
ADF Essentials Training by Deepak Bhagat
28.10 Programmatically Closing Popup
1) After running above lab, click cross (X) in pop-up to close pop-up.
2) Observe the message HREmpListBean.departmentPopupCancelHandler() in Log
window.
3) Open the HREmpListBean.java and explore departmentPopupCancelHandler()
method.
4) Open the pop-up again and click Done Outside Region button and observe message in
Log window.
5) Open the HREmpListBean.java and explore popupOutsideDoneButtonHandler()
method.
6) Open the pop-up again and click Done Inside Region button and observe message in Log
window.
7) Open the HRDepartmentDetailBean.java & HRDeptManagarDetailBean.java to
explore doneHandler() method.
8) Also explore BATADFUtil.closePopup() method under the package
bat.lab.hrsystem.ui.utils.
403/454
ADF Essentials Training by Deepak Bhagat
28.11 Rendering Dynamic Region
404/454
ADF Essentials Training by Deepak Bhagat
28.12 Adding Context Menu
405/454
ADF Essentials Training by Deepak Bhagat
28.13 Creating Data Control Method from Backing Bean
406/454
ADF Essentials Training by Deepak Bhagat
28.14 Contextual Events
407/454
ADF Essentials Training by Deepak Bhagat
28.15 Publishing Contextual Event
408/454
ADF Essentials Training by Deepak Bhagat
28.16 Subscribing and Handling Contextual Event to Region
409/454
ADF Essentials Training by Deepak Bhagat
28.17 Subscribing and Handling Contextual Event to Page
410/454
ADF Essentials Training by Deepak Bhagat
28.18 Programmatically Adding Partial Page Refresh
411/454
ADF Essentials Training by Deepak Bhagat
28.19 Programmatically Handling UI Create Transaction
412/454
ADF Essentials Training by Deepak Bhagat
28.20 Programmatically Handling UI Delete Transaction
413/454
ADF Essentials Training by Deepak Bhagat
28.21 Lab Solution
414/454
ADF Essentials Training by Deepak Bhagat
28.22 Advance ADF Extended Examples -x
Some of these advance ADF topics may be found as independent extended examples under
…\BATHandouts\BATXtEg-Proprietary\L28-BATXtEg-AdvanceADF. For hands-on
practice, please refer to Deepak Bhagat’s Blog at https://cloudadfdeepakb.blogspot.com or
download from the above location.
415/454
ADF Essentials Training by Deepak Bhagat
28.23 Entity-Level Triggers -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L28-ADFXtEg-AdvanceADF\.
This example demonstrates ADF BC 12c New Feature - Entity-Level Triggers.
416/454
ADF Essentials Training by Deepak Bhagat
29
Integrating ADF with
Web Service
417/454
ADF Essentials Training by Deepak Bhagat
29.1 Creating REST Web Service with ADF Business Service
1) Create the ADF Fusion Web Application named x with DepartmentsEO, DepartmentsVO
and AppModuleAM in the package bat.
2) Open the AppModuleAM.
a) Click the Web Service page.
e) In the Resource Name field, enter Department and select Release Version
adf12.2.1. (if it already not selected)
f) Click OK. Save All.
5) IDE generates a separate project RESTWebService for REST Web Service and a REST
Resource file under AppModuleAM to configure custom methods, view objects and
attributes etc.
BAT
bat
bat
bat
bat
BAT
BAT
BAT
BAT
420/454
ADF Essentials Training by Deepak Bhagat
BAT
BAT
421/454
ADF Essentials Training by Deepak Bhagat
29.2 Creating SOAP Web Service with ADF Business Service
bat
422/454
ADF Essentials Training by Deepak Bhagat
d) On the Service View Instances page of the wizard, expose view object
Departments1 and enable operations on Department view object (such as Create,
Update, Delete….). Click Finish. Save All.
423/454
ADF Essentials Training by Deepak Bhagat
bat
bat
bat
bat
424/454
ADF Essentials Training by Deepak Bhagat
29.3 Consuming REST Web Service (ADF)
1) Create the ADF Fusion Web Application named BATConsumeRESTWSADF_Eg in the package
bat.
2) Right-click the Model project > New > select From Gallery.
New Gallery wizard appears.
3) Expand the Business Tier > select Data Controls (in Categories section at left-side) >
Web Service Data Control (SOAP/REST) (in Items section at right-side). Click OK.
Create Web Service Data Control wizard appears.
426/454
ADF Essentials Training by Deepak Bhagat
29.4 Consuming REST Web Service (Generic)
427/454
ADF Essentials Training by Deepak Bhagat
DCIteratorBinding addressComponentsIterator =
((DCBindingContainer)
bindings).findIteratorBinding("address_componentsIterator");
addressComponentsIterator.setRangeSize(-1);
Row[] rows = addressComponentsIterator.getAllRowsInRange();
if (rows != null) {
Optional<String> postalCode = Arrays.stream(rows)
.map(e -> (DCDataRow) e)
.map(e -> (Map) e.getDataProvider())
.filter(map -> ((List)
map.get("types")).contains("postal_code"))
.map(e -> (String) e.get("long_name"))
.map(e -> {return (e == null ? "Nothing found" :
e);}) .findFirst()
;
postalCode.ifPresent(this::setPostalCode);
}
}
22) Comment out table with address components.
23) Run page.
428/454
ADF Essentials Training by Deepak Bhagat
29.5 Consuming SOAP Web Service
1) Create the ADF Fusion Web Application named BATConsumeSOAPWS_Eg in the package bat.
2) Right-click the Model project > New > select From Gallery.
New Gallery wizard appears.
3) Expand the Business Tier > select Data Controls (in Categories section at left-side) >
Web Service Data Control (SOAP/REST) (in Items section at right-side). Click OK.
Create Web Service Data Control wizard appears.
429/454
ADF Essentials Training by Deepak Bhagat
6) In the URL field, enter http://www.webservicex.net/country.asmx?WSDL.
7) Very Important: uncheck the Copy WSDL Locally. Click Next.
8) Shuttle the GetCountries, GetCurrencyByCountry from CountrySoap to Selected pane.
Click Finish.
9) Create the page named Index.jsf.
10) Drag and drop GetCountries to the page > select Button.
11) Drag the String > select Output Text Formatted and assign Partial Trigger to button
b1.
12) Optionally, color the output text, wrap in Panel Form and add a Separator.
13) Drag and drop GetCurrencyByCountry to the page > select ADF Parameter Form.
14) Drop the String > select Output Text Formatted and assign Partial Trigger to button
b2.
15) Run the Index.jsf.
16) Click the GetCountries button. Enter a country name example Japan and click
GetCurrencyByCountry button.
430/454
ADF Essentials Training by Deepak Bhagat
29.6 Advance ADF Extended Examples -x
These advance ADF topics may be found as independent extended examples under
…\BATHandouts\BATXtEg-Proprietary\L29-BATXtEg-Integrating-WebService.
For hands-on practice, please refer to Deepak Bhagat’s Blog at
https://cloudadfdeepakb.blogspot.com or download from the above location.
431/454
ADF Essentials Training by Deepak Bhagat
29.7 More Examples on ADF Integration with Web Services -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L29-ADFXtEg-Integrating-WebService\.
These examples demonstrate ADF Integration with Web Services.
432/454
ADF Essentials Training by Deepak Bhagat
30
Integrating ADF with
Enterprise Java Bean
(EJB)
433/454
ADF Essentials Training by Deepak Bhagat
30.1 Consuming EJB Data Control
434/454
ADF Essentials Training by Deepak Bhagat
30.2 Advance ADF Extended Example -x
This advance ADF topics may be found as independent extended example under
…\BATHandouts\BATXtEg-Proprietary\L30-BATXtEg-Integrating-EJB. For hands-
on practice, please refer to Deepak Bhagat’s Blog at https://cloudadfdeepakb.blogspot.com or
download from the above location.
435/454
ADF Essentials Training by Deepak Bhagat
30.3 More Examples on Consuming EJB Data Control -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L30-ADFXtEg-Integrating-EJB\.
These examples demonstrate Consuming EJB Data Control.
436/454
ADF Essentials Training by Deepak Bhagat
31
Integrating ADF with
Service Orientated Architecture
(SOA)
437/454
ADF Essentials Training by Deepak Bhagat
31.1 Integrating SOA
1) Create the ADF Fusion Web Application named BATSOAIntg_Eg with DepartmentsEO,
DepartmentsVO & AppModuleAM in package bat.
2) In the AppModuleAMImpl.java, add getDeptName() method .
public String getDeptName(Integer deptId) {
String deptName = "Department not found";
ViewObject deptVo = getDepartments1();
Row[] filteredRows = deptVo.getFilteredRows("DepartmentId",
deptId);
if (filteredRows.length > 0) {
deptName =
filteredRows[0].getAttribute("DepartmentName").toString();
}
return deptName;
}
3) Open the AppModuleAM in the editor.
4) Click the Web Service page.
5) Ensure SOAP tab is selected. Click icon.
a) In the Name field, enter SOAModuleService.
b) Skip built in methods and expose custom method getDeptName(). Expose view
object Department and enable operations on Department view object.
6) Right-click the Model project > select Project Properties.
a) In the Project Properties window, select Deployment from list. Click the New
Profile icon.
b) In the Create Deployment Profile wizard, in Profile Type field select Business
Components Service Interface and in Deployment Profile Name enter
BATSOABusinessService.
c) Click OK and again click OK.
7) Run the server.
a) Click the Run menu > select Start Server Instance
(IntegratedWebLogicServer).
8) Click the Application menu > Deploy > select Model_BATSOABusinessSevice.
9) Select Deploy to Application Server, click Next and click Finish.
10) Observe in Deployment-Log window, statement “Deployment finished”. Alternatively,
deployment can be done from WLS console.
11) Open the WebLogic Sever Administration Console (http://127.0.0.1:7101/console), login
with Username: weblogic and Password: weblogic1.
12) Go to Deployments, select Model_BATSOABusinessSevice > Testing tab.
13) Expand the BATSOAIntg_Eg-Model-context-root and copy URL and paste it in a new
browser and append service name SOAModuleService, press Enter. Web Service Test
Client page opens.
438/454
ADF Essentials Training by Deepak Bhagat
14) Perform tests on methods and operations getDeptName, create, update, delete,
find.
439/454
ADF Essentials Training by Deepak Bhagat
31.2 Advance ADF Extended Example -x
This advance ADF topics may be found as independent extended example under
…\BATHandouts\BATXtEg-Proprietary\L31-BATXtEg-Integrating-SOA. For hands-
on practice, please refer to Deepak Bhagat’s Blog at https://cloudadfdeepakb.blogspot.com or
download from the above location.
440/454
ADF Essentials Training by Deepak Bhagat
31.3 More Examples on Integrating Oracle SOA with ADF -d
This topic is part of the Advance ADF extended example, taken from the web. For optional self-
paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L31-ADFXtEg-Integrating-SOA\.
These examples demonstrate ADF integration with Service Oriented Architecture (SOA).
441/454
ADF Essentials Training by Deepak Bhagat
32
Integrating ADF with
Mobile Application Framework
(MAF)
442/454
ADF Essentials Training by Deepak Bhagat
32.1 Mobile Application Framework (MAF)
4 Click on Next button. Click on I Agree button on License Agreements page, click on Next
button. Click on Finish.
443/454
ADF Essentials Training by Deepak Bhagat
B. Download and Install Android Studio:
1. Download Android Studio from https://developer.android.com/studio/index.html.
7 Select Android 5.1 Lollipop in SDK Platforms page. (Uncheck defaults) Click on OK.
8 Click on SDK Tools tab. Make sure Android SDK Build-Tools, Android SDK Platform-Tools,
Android SDK Tools, Intel x86 Emulator Accelerator (A=HAXM Installer), Android Support
Repository, Google Repository packages were installed.
444/454
ADF Essentials Training by Deepak Bhagat
445/454
ADF Essentials Training by Deepak Bhagat
C. Setting Preferences in JDev and in (Android Virtual Device) AVD Manager:
1. Open JDeveloper. Click on Tools > Preferences. On the left side of the Preferences screen,
click and expand the Mobile Application Framework node. If you are using the Mobile
Application Framework extension for the first time, you may need to click the Load Extension
button.
446/454
ADF Essentials Training by Deepak Bhagat
11 Update all entries with the correct directory locations and click on OK button.
12 Re-open the Android Studio. Click on Tools > Android > AVD Manager.
13 Click on Create Virtual Device button at the bottom in Your Virtual Devices page.
447/454
ADF Essentials Training by Deepak Bhagat
14 Click on New Hardware Profile button at the bottom in Select Hardware page.
448/454
ADF Essentials Training by Deepak Bhagat
15 Specify the above values to the properties. Click on Finish.
16 Click on Next button in Select Hardware page.
449/454
ADF Essentials Training by Deepak Bhagat
17 Download required OS in System Image page. (select Lollipop for this sample)
18 Click on Next and click on Finish.
19 Click on Run ( ) icon in Your Virtual Devices page. (It may take a few minutes for the
emulator to be invoked and start running. Once it's running, you may continue and test your
mobile deployment.)
450/454
ADF Essentials Training by Deepak Bhagat
20 Open the command prompt and run the following commands to check status of Emulator.
451/454
ADF Essentials Training by Deepak Bhagat
7) In the Create MAF Feature window, in the Feature Name field, enter Success, in the
Feature ID field, enter bat.Sucess.
8) In the Features table, select newly created feature bat.Success. Under Features table,
click Content tab, and locate Content table.
9) Notice the content item bat.Success.1 is created by default.
10) In the Content area, in the Type field, enter Local HTML.
11) In the Content section, find URL text box. On right side of URL text box, select Index.html
from system by clicking magnifying glass icon.
12) Confirm your emulator is still running. At bottom of emulator.
13) Click the Applications icon and all installed applications will be visible. Keep emulator open
and return to JDeveloper.
14) Create the New Deployment Profile.
15) In the Create Deployment Profile window, in Profile Type field, select MAF for Android
from drop-down and in Deployment Profile Name field, enter Android2.
16) Click the Application menu > Deploy > select Android 2 from context-menu.
17) In the Deploy window, select Deploy application to emulator and click Finish.
18) Observe the Deployment Log window. If compilation and deployment process complete
as expected, you should see Deployment Log window with Success.
19) Navigate back to Emulator. You should see BATMAF_Eg application you just created and
deployed.
20) Click the BATMAF_Eg icon to start application.
21) BATMAF_Eg application currently contains your HTML page running inside MAF application.
Here you can see text Deployment Successful.
22) If you are finished. Close emulator, but remember to restart it before you want to deploy
to it again.
452/454
ADF Essentials Training by Deepak Bhagat
32.2 Advance ADF Extended Example -x
This advance ADF topics may be found as independent extended example under
…\BATHandouts\BATXtEg-Proprietary\L32-BATXtEg-Integrating-MAF. For hands-
on practice, please refer to Deepak Bhagat’s Blog at https://cloudadfdeepakb.blogspot.com or
download from the above location.
453/454
ADF Essentials Training by Deepak Bhagat
32.3 More Examples on Integrating Oracle MAF with ADF -d
This topic is part of the Advance Oracle ADF extended example, taken from the web. For optional
self-paced hands-on practice, it may be further downloaded from
…\BATHandouts\OADFXtEg-Downloaded\L32-ADFXtEg-Integrating-MAF\.
These examples demonstrate ADF integration with Oracle Mobile Application Framework (MAF).
454/454
ADF Essentials Training by Deepak Bhagat