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



Sep 13, 2011, 11:04 AM
14 Posts
topic has been resolvedResolved

Put a NotesDocumentCollection into a sessionScope variable doesn't work

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: sessionScope,NotesDocumentCollection
  • Replies: 2
Hi @All,
 
I'm trying to put a NotesDocumentCollection into a sessionScope. Therefore I have a simple XPage with two buttons. 
 
Button one includes the following code in the onClick Event: 

var nvwLookup:NotesView = session.getCurrentDatabase().getView("myView");
var colLookup:NotesDocumentCollection = nvwLookup.getAllDocumentsByKey("Whatever");
sessionScope.put("myCol", colLookup);
 
Button two includes the following code in the onClick Event: 
 
var colScope:NotesDocumentCollection = sessionScope.get("myCol");
if(colScope != null){
print(colScope.getCount());
}

After I hit button one, the collection was put into the sessionScope. I cross checked this with the "Xpages Debug Custom Control". Thx to Ferry for this great control.
If I hit button two I get an exception at the print statement: Exception occurred calling method NotesDocumentCollection.getCount() null

Any ideas what I'm doing wrong or is there just no way to put a NotesDocumentCollection into a scope variable?
 
I'm using 8.5.2 FP2 
 
Thx for helping me. 
Sep 13, 2011, 11:31 AM
14 Posts
Re: Put a NotesDocumentCollection into a sessionScope variable doesn't work
 Thx Paul for your fast reply and the link.

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