Java Developer
ORACLE ADF BY FRANK NIMPHIUS
Add Advanced List
Interaction
Use model-driven LOVs in Oracle ADF to implement
smart lists with autosuggest behavior.
ORACLE JDEVELOPER and ORACLE APPLICATION DEVELOPMENT FRAMEWORK
Using lists of values (LOVs) in Oracle Application Development Framework
(Oracle ADF) is a great way to prevent end
users from entering invalid data. With
dependent LOVs, you can further enhance
user efficiency by filtering lists on external
conditions. This column will show you
how the LOV features in Oracle ADF help
you build rich, intelligent list and search
capabilities without requiring full-blown
Java coding.
To begin, go to bit.ly/gLhag3, which will
automatically download the starter workspace in a zip file called o41adf-359201.zip.
Note that it contains two folders, one containing a starter workspace and the other a
completed version. Ensure that you’re using
the studio edition of the Oracle JDeveloper
11g 11. 1. 1. 4 (or later) release, available as a
free download on the Oracle Technology
Network at oracle.com/technetwork/
developer-tools/jdev/downloads. The application uses the HR schema that’s available
by default in Oracle Database.
the AdfListOfValues.jws workspace in the
AdfListOfValues folder. Before proceeding,
adjust the properties of the connection
named hrconn in the Application Resources
zone of the Application Navigator until you
can successfully test a connection to the HR
database schema.
The sample workspace contains two
projects: Model and ViewController.
The Model project contains four view
objects: DepartmentsView, JobsView,
ManagersView, and EmployeesView. You’ll
start by defining LOVs for attributes of the
EmployeesView object. The other three
view objects provide the data for the lists.
The ViewController project contains a
single page, SamplePage.jspx, that you’ll
use to test the model-driven LOVs in a
Web environment.
BUILDING LOVS FOR THE
EMPLOYEESVIEW OBJEC T
Double-click the EmployeesView object in
the Model project’s adf.oramag.sample
.model.vo package to open it in the object
editor. Select the Attributes category, and
SAMPLE APPLICATION OVERVIE W
The biggest challenge in developing LOVs
in large enterprise applications is to maintain functional and user interface consistency across pages. Model-driven LOVs
help you meet this challenge by enabling
you to define an LOV in a single place;
any subsequent modifications to the list
propagate to all instances of the list. In
this example, you’ll see how to use Oracle
JDeveloper to create dependent, model-driven LOVs that provide smart lists—
filtered lists with default selection values
and autosuggest behavior.
Launch Oracle JDeveloper, and
browse to the directory where you
unzipped the starter workspace. Open
Figure 1: Adding a view accessor
ORACLE MAGAZINE JULY/AUGUS T 2011