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



Jun 23, 2011, 2:33 PM
33 Posts

How to remove bean from the view scope?

  • Category: Managed Beans in NSF
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 1
As Thimo pointed out here >> http://blog.thimojansenit.nl/2011/05/xpages-java-bean-lessons-of-day.html the bean instance can be removed from the scope e.g.
 
     facesContext.getExternalContext().getSessionMap().remove("User");
 
removes the bean instance called User from Session scope.
If you try to do that for the bean that lives in View scope it does not work. Does anybody knows how to achieve that?

 
Jun 30, 2011, 4:49 PM
129 Posts
Re: How to remove bean from the view scope?
Try this to get the map:
view.getViewMap() 
 
This is the same as viewScope ( view.getViewMap().equals( viewScope ) -> true ) . The same with facesContext.getExternalContext().getSessionMap() and sessionScope.   
 
If you're working with java code to manipulate the viewScope, then you could go this route. Get the view instance/getViewMap, and manipulate the viewScope accordingly.
 
<self promotion> 
I used my XPages API Inspector to find out the above. If you're trying to do stuff with the API that your friend Google can't help you with, it's quite useful to mess about with the API using the inspector
 
http://www.openntf.org/projects/pmt.nsf/ProjectLookup/XPages%20API%20Inspector 
</self promotion> 

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