Please disable your adblock and script blockers to view this page

Search this blog

Tuesday, 11 October 2016

OTN Appreciation Day: Oracle ADF Bindings #ThanksOTN

Hello Everyone

I am late still I thought to write about Oracle ADF Bindings for OTN Appreciation Day

ADF binding layer works as glue between Model and View layer, Values from model propagates to page through Binding layer

UI Components are associated with business logic through this layer , this reduce lots of developer effort , it maintains row state , fetching mechanism etc.
Binding definition of components are defined in a XML file called page definition, Model layer uses this file to instantiate the page's bindings


A request scope map called Binding Container holds the bindings for the current page or view port and bindings can be accessed using EL Expression #{bindings}

Method to get Binding Container

import oracle.binding.BindingContainer;
import oracle.adf.model.BindingContext;


    /*
     *Method to get Binding Container of current View Port
     */
    public BindingContainer getBindingsCont() {
        return BindingContext.getCurrent().getCurrentBindingsEntry();
    }


When we use data control to create any component on page then Jdeveloper automatically creates it's bindings in page definition XML file

Types of Binding

Attribute binding- Used to bind to a single attribute value such as EmployeesName, It is used to bind input text, output text etc

Action binding- Used to bind action command like Create, Delete, Commit etc, typically used with buttons , link etc

Tree binding- Used to bind a data collection like table, treeTable or list, It presents a collection of data having multiple attributes
Related post- Tree Table Component with declarative presentation in ADF, Access childs without custom selection listener

List binding- Used to bind simple lists of data as choice list

Method binding- Used to bind any custom method defined in any Java implementation class (Application Module or ViewObject Impl classes)
Related post- ADF Basics: How to invoke model layer methods from managed bean (Best Practice to write business logic in ADF)

Iterator Binding- Used to bind Attribute, tree bindng to iterator of data collection, Iterates over the business objects of the data collection and maintains the row state and properties

So this was an overview of ADF Binding layer and the reason why I like ADF Bindings is that It works as glue between both layers and we need not to code a single line for binding UI component to model layer
Suppose if I have to develop a form of Employees Details with CRUD and Search Operation then there is no need of writing a single line of code, all can be done using ADF Binding layer

#Thanks OTN


4 comments :

  1. I know that has no relate to subject of the post but i have an issue that i cann't solve I have table with one column that has lov that is input text with list of values when i choose it it clear all other fields only if the primary key is DBSequance i use jdeveloper 12c

    ReplyDelete
    Replies
    1. Try setting autoSubmit to true for other fields or set changeEventPolicy of iterator to none and check again

      Delete
    2. thanks ashish but it that solution will make me to add partial trigger on detail table to feel changes in master
      the case that i have many forms as master and tables as details and this happen in all detail table if i set changeEventPolicy of iterator to none that mean any detail for that table must have partial trigger on it

      Delete
    3. You have to do that or you can try setting autoSubmit false for your LOV and check if it works

      Delete