Professional Documents
Culture Documents
Are Like
This
Survey
Agenda
Overview
Java development
Binding Examples
1-3 years?
4-17 years?
17+ years?
JDeveloper
1-2 years?
2+ years?
3
Additional
information in
the appendixes.
ADF Bindings
Association of a business service data
element or action with a UI control
A layer of ADF
View
ADF Bindings
Application Client
Web Client
Struts
Model
ADF Bindings
JSF
Controller
User Interface
Business Services
Data
Bindings
Overview
Binding
Control
Control
Binding
Page
Control
Control
Control
Binding
Container
Binding
Binding
Binding
Data
Control
Creating/Accessing
PageDef file
DataBindings.cpx
Binding Examples
Binding Context
Binding
Container
Page
Susan
Agenda
View Layer
EMPLOYEES
Database
Business
Components Layer
Data
Control
Nodes for
mainMap
Data control
Data collection
Attribute
Nested data collection
Operation
Method
bindings
Next
Salary
10
EL Syntax
Expression Language
A.k.a.:
${} or #{}
#{subMap.subSubMap1.object3}
${object1}
#{subMap.subSubMap2.object4}
mainMap
object1
object2
subMap
subSubMap1
subSubMap2
object3
object4
Collections of objects
11
12
EL for ADF
<af:inputText
value="#{bindings.EmployeeId.inputValue}"
label="#{bindings.EmployeeId.label}"/>
13
14
Agenda
Overview
Working with Bindings
Creating/Accessing
PageDef file
DataBindings.cpx
Binding Examples
15
16
Navigator
OR Bindings tab on the JSF
page
18
Bindings
Values and operations
required on the page
19
Creating BindingsAlternative 1
Use the Structure window for the PageDef file
Creating BindingsAlternative 2
Bindings tab on the JSPX page
21
22
Agenda
Overview
Working with Bindings
Creating/Accessing
PageDef file
DataBindings.cpx
Binding Examples
23
24
DataBindings.cpx
DataBindings.cpx DC Usages
<dataControlUsages>
<BC4JDataControl id="HRServiceDataControl"
Package="hr.model"
FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"
SupportsTransactions="true"
SupportsFindMode="true"
SupportsRangesize="true"
SupportsResetState="true"
SupportsSortCollection="true"
Configuration="HRServiceLocal"
syncMode="Immediate
xmlns="http://xmlns.oracle.com/adfm/datacontrol"/>
</dataControlUsages>
26
Agenda
Model
editEmployees.jspx
First Name
#{bindings.FirstName.inputValue}
Business Services
HRService.xml
(application module)
Overview
editEmployeesPageDef.xml
<executables>
<iterator
Binds="AllEmployees
DataControl="HRServiceDataControl
id="EmployeesByDeptIterator">
<bindings>
<attributeValues
IterBinding=
"EmployeesByDeptIterator
id="FirstName">
Binding Examples
AllEmployees
FirstName
DataBindings.cpx
Employees
JDBC
<BC4JDataControl
id="HRServiceDataControl
Configuration="HRServiceLocal"
27
28
Attribute Bindings
Attribute
List
For data-bound list elements
List of Values
For view object lists of values
Tree
#{bindings.DepartmentId.inputValue}
(returns 2500)
#{bindings.DepartmentId.label}
(returns Department ID)
mainMap
Boolean
bindings
For checkboxes
DepartmentId
Action
For standard operations like Commit
label
Method
For custom methods
29
30
JSF
Code Snippets
<af:inputText value="#{bindings.DepartmentId.inputValue}"
label="#{bindings.DepartmentId.hints.label}"
required="#{bindings.DepartmentId.hints.mandatory}"
columns="#{bindings.DepartmentId.hints.displayWidth}"
maximumLength="#{bindings.DepartmentId.hints.precision}"
shortDesc="#{bindings.DepartmentId.hints.tooltip}"
id="it1">
</af:inputText>
PageDef
<bindings>
<attributeValues IterBinding="DepartmentsView1Iterator"
id="DepartmentId">
<AttrNames>
<Item Value="DepartmentId"/>
</AttrNames>
</attributeValues>
<af:inputText
value="#{bindings.PhoneNumber.inputValue}"
label="#{bindings.PhoneNumber.label}"
columns="#{bindings.PhoneNumber.displayWidth}"/>
31
32
Tree Bindings
labels
DepartmentId
DepartmentName
ManagerId
Usually row
33
PageDef Snippets
34
<bindings>
<table
id="AllEmployees"
IterBinding=
"EmpResultsIterator">
<AttrNames>
<Item Value="EmployeeId"/>
<Item Value="FirstName"/>
<Item Value="LastName"/>
<Item Value="Email"/>
<Item Value="PhoneNumber"/>
<Item Value="HireDate"/>
<Item Value="JobId"/>
<Item Value="Salary"/>
<Item Value="ManagerId"/>
</AttrNames>
</table>
<executables>
<iterator
id="EmpResultsIterator"
RangeSize="10"
Binds="AllEmployees
DataControl=
"TuhraServiceDataControl"/>
<iterator
id="AllJobsIterator"
RangeSize="-1"
Binds="AllJobs
DataControl=
"TuhraServiceDataControl"/>
</executables>
Table Binding
Iterator
35
<af:table
value="#{bindings.AllEmployees.collectionModel}" var="row"
rows="#{bindings.AllEmployees.rangeSize}"
first="#{bindings.AllEmployees.rangeStart}"
selectionState=
"#{bindings.AllEmployees.collectionModel.selectedRow}"
selectionListener=
"#{bindings.AllEmployees.collectionModel.makeCurrent}"
width="100%">
<af:column
headerText="#{bindings.AllEmployees.labels.EmployeeId}"
sortProperty="EmployeeId" sortable="true">
<af:outputText value="#{row.EmployeeId}"/>
</af:column>
<af:column
headerText="#{bindings.AllEmployees.labels.FirstName}"
sortProperty="FirstName" sortable="true">
<af:outputText value="#{row.FirstName}"/>
</af:column>
Appendix A: more binding examples
36
Action Bindings
What is an Iterator?
Collection operations
#{bindings.EmployeeId.inputValue}
The employee ID of whatever row is currently pointed to by
the iterator
Commit, Rollback
JSF
<af:commandButton
text="Save"
actionListener="#{bindings.Commit.execute}"
disabled="#{!bindings.Commit.enabled}"/>
PageDef
<action id="Commit" RequiresUpdateModel="true"
Action="commitTransaction"
DataControl="HRServiceDataControl"/>
37
Iterator An Executable
38
Current
row
Current
range
39
40
Summary
Designer
Handbook
ORACLE9i
JDeveloper
Handbook
Developer
Advanced
Forms &
Reports
JDeveloper 3
Handbook
ORACLE
JDeveloper 10g
Handbook
www.quovera.com
Ch.
14-15
41
Appendixes
42
Table Bindings
A.k.a., range bindings
Expose data from all rows in the iterator
bindings current range
Expose some or all columns
Iterators collectionModel property is
used as the tables value
A variable in the table UI
component is assigned to the
table bindings data
Usually row
43
44
List Bindings
Dynamic or static
bindings
DepartmentId
<af:selectOneChoice
value="#{bindings.AllEmployeesJobId.inputValue}"
/>
displayData
label
45
46
47
48
Method Bindings
49
Appendixes
50
51
52
Iterator Details
#{bindings.EmployeeId.inputValue}
The employee ID of whatever record is currently
pointed to by the iterator
54