This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 10, 2011, 7:25 PM
57 Posts

Re: xPage Current Doc from within a Managed Bean

  • Category: Managed Beans in NSF
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: Managed Bean
  • Replies: 4
Another option to reach all datasource defined within a view is
List<Datasource> dataSourceList=((com.ibm.xsp.component.UIViewRootEx2)(FacesContext.getCurrentInstance() .getViewRoot())).getData();
 
then you go further, get Xpages runtime object and get actual data
as followinf if your datasourc is a document (assuming that you only have one datasource defined in your xpages)
com.ibm.xsp.model.domino.wrapped.DominoDocument doc = (com.ibm.xsp.model.domino.wrapped.DominoDocument) dataSourceList.get[0].getDataObject();

doc.getItemValue("paramA");
 
a little bit add up is that FacesContext.getCurrentInstance() .getViewRoot() returns only JSF default viewRoot, and we can't access domino datasource through this viewroot, unless you cast it as com.ibm.xsp.component.UIViewRootEx2,
( domino ViewRoot )
 
 
Apr 20, 2011, 5:19 AM
26 Posts
Re: xPage Current Doc from within a Managed Bean
 Hello,
 
I am searching for some tutorial for using Managed Beans in XPages. Could you pls redirect me to any help docs or tutorials for the same? 
 
Thanking you in advance. 
 
Regards, 
Yusuf 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal