Tuesday, April 1, 2014

How to get ViewObject and RowImpl class in Backing bean using DCIteratorBindings in ADF ?


Below blog explains about how to get View Object and Row Impl class in backing bean using DCIteratorBindings

import oracle.adf.model.binding.DCIteratorBinding;

    /**
     * Find an iterator binding in the current binding container by name.
     *
     * @param name iterator binding name
     * @return iterator binding
     */
    public static DCIteratorBinding findIterator(String name) {
        DCIteratorBinding iter = getBindingContainer().findIteratorBinding(name);
           return iter;
    }


    public static BindingContainer getBindingContainer() {
        return (BindingContainer)JSFUtils.resolveExpression("#{bindings}");
    }
Example how to use

Get the Row Impl class in Backing bean, Ensure 'EmployeeViewIterator' must be available in page definition bindings.

        EmployeeViewRowImpl empRow =
            (EmployeeViewRowImpl )findIterator("EmployeeViewIterator").getCurrentRow();


Below code sample shows how to get View Object instance in backing bean using DIteratorBindings, Ensure 'EmployeeViewIterator' must be available in corresponding page definition bindings
        ViewObject agreementLocationViewObject =
            findIterator("EmployeeViewIterator").getViewObject();

No comments:

Post a Comment