About Me

My photo
San Fransisco, Bay Area, California, United States
• SIX years of extensive experience in ERP development and Enterprise Applications Practice with proven experience in Developing and customizing Oracle Financials 11i and R12 and Fusion Application Development (FCH, GL, EPF and EPB modules) on AOL of Oracle E-business Suite. • Worked for the Oracle Financials Applications Technology Team and Financial Consolidation Hub (FCH) Application Development group. • Expertise in Oracle Fusion Technologies like Hyperion Essbase, ADF and BPEL • Expertise in development and maintenance of Self-Service Applications using Oracle Application Framework (OAF), Web ADI, XML Publisher based products and frameworks for integration capabilities of the Oracle e-Business Suite. • Excellent track record demonstrating strong analytical and problem solving skills, computer proficiency, and ability to follow through with projects from inception to completion. • Competent in preparing and delivering presentations to both technical and executive positions.

Tuesday, October 21, 2008

ADF:Invoking AM methods from the Managed Bean

Pure JSF way:
-------------

FacesContext facesContext=FacesContext.getCurrentInstance();
ExpressionFactory exp=facesContext.getApplication().getExpressionFactory();
MethodExpression getDeptNames = exp.createMethodExpression(facesContext.getELContext(),
"#{bindings.getAllDepts.execute}", null,new Class[]{});
HashMap map=(HashMap)getDeptNames.invoke(facesContext.getELContext(),null);



ADF way:
---------

Packages to be imported

import javax.el.ExpressionFactory;

import javax.faces.application.Application;
import javax.faces.context.FacesContext;

import oracle.adf.model.OperationBinding;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;

Sample Code Snippet:
-------------------
FacesContext fctx = FacesContext.getCurrentInstance();
Application app = fctx.getApplication();
ExpressionFactory exp=fctx.getApplication().getExpressionFactory();

DCBindingContainer bc;
bc = (DCBindingContainer)exp.createValueExpression(fctx.getELContext(),
"#{bindings}",DCBindingContainer.class).
getValue(fctx.getELContext());

//Get Current Row Handle
DCIteratorBinding iter = bc.findIteratorBinding("Emp2Iterator");
Row row = iter.getCurrentRow();
Number empNo = (Number)row.getAttribute("Empno");

//get Access to Method Binding

OperationBinding operation = (OperationBinding)bc.get("printANumber");
operation.getParamsMap().put("data", empNo);
operation.execute();

No comments: