Friday, March 5, 2010

ADF Model: How to Programmatically Access the DataProvider Thing

"One of the 'power tools' of ADF Binding is the dataProvider attribute that pretty much every binding object supports." -Duncan Mills

Duncan Mills has a comprehensive blogpost about this DataProvider thing here. When I was still on my first steps in learning ADF, I found it a challenge to programmatically access this DataProvider thing without using the JSFUtils.resolveExpression() method, that is why I thought that maybe it would be helpful for others who are still beginning their Oracle ADF experience if I will post here what I have figured out.

    public Object getCurrentRowDataProvider(String iteratorName) {
        BindingContainer bindings = getBindings();
        DCIteratorBinding dcib =
        RowSetIterator iter = dcib.getRowSetIterator();
        DCDataRow row = (DCDataRow)iter.getCurrentRow();
        return row.getDataProvider();
    public BindingContainer getBindings() {
        return (BindingContainer)JSFUtils.resolveExpression("#{bindings}");
Illustrative usage:
    public void save(ActionEvent event){
        Employee employee = (Employee)getCurrentRowDataProvider("findAllEmployeesIterator");
        //some other codes like setting some default properties for the employee
        //or accessing the object attributes from employee
        //invoke saveEmployee methodAction
        OperationBinding oper = getBindings().getOperationBinding("saveEmployee");


  1. Hi, thanks for your post. I tried this piece. But i'm getting error at " return (BindingContainer)JSFUtils.resolveExpression("#{bindings}");"

    stating "resolveExpression" not found. May i know which util version util class is this.

    My jdev is and getting not

  2. Hi,
    You could get the must-have JSFUtils from the demo application of JDeveloper - the StoreFront demo (Fusion Order Demo)from this link:


  3. Thanks a lot Pino. Will Try that.

  4. so cool blog! I really like it!

  5. interesting topic
    thanks for your information