Tuesday, 27 November 2012

Invoke ADF bindings in page templates

In order to access method binding in page template pagedef , get its reference in consumer pagedef executable section. We can use standard ADFUtil for this. Find the attached ADFUtil here

In DataBindings.cpx file, we can find the pagetemplate pagedef id.


Executable section of consumer pagedef :

    public void getEmployeeRecord() {       
        //access page template Pagedef reference in executable section of consumer page PageDef
        DCBindingContainer binding =
           (DCBindingContainer)ADFUtil.evaluateEL("#{bindings.data.portal_pageTemplate_globePageDef}");
      
        //get the MethodBinding
        OperationBinding operationbinding = (OperationBinding)binding.get("getEmployeeNames");
       
        //invoke the method
        if (operationbinding != null)
            operationbinding.execute();
    }

1 comment: