You are on page 1of 5

ADF BINDING

The Goal of “binding” in ADF is to map the various business service sources such as database, web
services data, and POJO data into the UI components that would present the data more effectively and
accurately with the ability to interact both ways between the business services and UI Applications.

Data Control and


Business Service UI Components
ADF Binding

Figure 1

∗ Data Controls extracts the underlying structure of the data collection or actions in the business
service and present the fields, operations according to the view objects created for the
application
∗ ADF Binding creates the necessary types of binding values from these data controls to be used in
the visual UI components.

Context:
Application created (Using Business Components or POJO)

Data Controls get created automatically when ‘business components’ used and view objects
defined Else by right click  create data controls they get created (In POJOs Data Control
Description files ’.dcx’ and Structured Definitions ‘.xml’ files for java files get created).

JSF Pages get created in the application,

When Data Controls are dragged and dropped into the pages and specific UI type selected
<Page_name>PageDef.xml gets created which will hold the connections for the bindings
through the executables with the data controls (figure 2) and ‘DataBindings.cpx’ is created
which keeps the mappings for pages and pagedef files.
Binding Objects
There are three kinds of Declarative Binding Objects

 Iterator Bindings - Tracks the current row in a given data collection


 Value Bindings - Binds UI Components to attributes values in a data collection
 Action Bindings - Used to invoke custom or built-in operations on data collection

Types of Bindings

Attribute Binding - Input text tern to a String value


Tree Binding - Make a Tree or Table to a data collection
List Binding – Exports set of legal values for the user to select one
Action Binding – Built in Operation or Custom methods

Using Bindings

Bindings can be simply created using the ADF process and could be simply accessed using the expression
language. Even though it’s possible as mentioned before, Bindings can be created using java classes as
well.

Expression Language can be used not only to get values but also for reaching attribute values of Bindings

Usage: # {bindings.EmpNo}  access values


# {bindings.Emps.rangesize}  access attributes of values

Binding Classes

Bindings are defined at design time in XML and objects are created at run time. There are two kinds of
binding classes. The Generic Binding Classes are named with the prefix “JUCtrl” and specific ADF faces
binding classes are named with the prefix “FacesCtrl” (Has the makeCurrent method).

Other than using Expression language to access the bindings, sometimes we would have to create and
access bindings using java code. Following are the reasons;

Execute custom code in the context of default functionality


Perform Complex operations and data access
Ensure the order of calls you need
Execute two event listeners in a sequence
Common Binding Classes

Binding Context: - Way to look up at the binding container and to find current binding container
File databindings.cpx at runtime
Expression language access to data controls - # {data}

Binding Container: - Objects for the bindings used in a given view


# {bindings} to access binding container
These can be done by manual java code as well

DCIteratorBinding: - Used to manipulate a data through provided methods.


This get created when using other bindings too
Have java codes too
- Not through inter return getCurrentBindingEntry,
findIteratorBinding

JUCtrlHierBinding: - for table, tree and tree table + DVT component bindings
Methods to give specific bindings to specific places
Figure 2: Bindings and Data Control Connections

Figure 3: Bindings and the UI Connections


Figure 4: Pages getting created

Figure 5: ADF Architecture and Binding Layer

You might also like