Incase of ADF applications, sometimes we need to access one managed bean properties from another managed bean. Following code provides details on how to access managed beans programmatically specified in different scopes.
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
ExternalContext exctx = FacesContext.getCurrentInstance().getExternalContext();
AppBean appBean = (AppBean) exctx.getApplicationMap().get("appBeanName");
SessionBean sessionBean = (SessionBean) exctx.getSessionMap().get("sessionBeanName");
RequestBean sessionBean = (RequestBean) exctx.getRequestMap().get("requestBeanName");
AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
ViewBean viewBean = (ViewBean)adfctx.getViewScope().get("viewBeanName");
PageFlowBean pageFlowBean = (PageFlowBean)adfctx.getPageFlowScope().get("pageFlowBeanName");
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
ExternalContext exctx = FacesContext.getCurrentInstance().getExternalContext();
AppBean appBean = (AppBean) exctx.getApplicationMap().get("appBeanName");
SessionBean sessionBean = (SessionBean) exctx.getSessionMap().get("sessionBeanName");
RequestBean sessionBean = (RequestBean) exctx.getRequestMap().get("requestBeanName");
AdfFacesContext adfctx = AdfFacesContext.getCurrentInstance();
ViewBean viewBean = (ViewBean)adfctx.getViewScope().get("viewBeanName");
PageFlowBean pageFlowBean = (PageFlowBean)adfctx.getPageFlowScope().get("pageFlowBeanName");
Dumass page implementation, can't copy paste your bullshit
ReplyDeleteI think it's not possible to copy/paste bullshit..what do you say!
DeleteIf he does not want other to copy the code by disabling the right click why publish at all?
DeleteJust use Ctrl A+Ctrl C and copy the code
are you getting paid to copy/paste the code from online?
DeleteThank's for you advice !!
ReplyDelete