Friday, March 15, 2013

ADF 11G : How to get the Application Module handling ?

  ADF 11G : How to get the Application Module handling ?

  public static ApplicationModuleImpl getAMInstance(String AM) {
         
            FacesContext fc = FacesContext.getCurrentInstance();
            Application app = fc.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = fc.getELContext();
            ValueExpression valueExp =
                elFactory.createValueExpression(elContext, "#{data."+AM+"DataControl.dataProvider}",
                                                Object.class);

            return (ApplicationModuleImpl)valueExp.getValue(elContext);
      
    }