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



May 12, 2012, 1:58 PM
68 Posts
topic has been resolvedResolved

viewScope - isEmpty don't work good ?

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer,Administrator
  • Tags:
  • Replies: 2
I tried to use isEmpty() function but it don't work good at all for example
 
viewScope.test.isEmpty() = ERROR 500 -> always 
 
viewScope.isEmpty() - its ok 
 
But if I want to check if  viewScope.test is empty how can I do this ?
May 12, 2012, 9:07 PM
33 Posts
Re: viewScope - isEmpty don't work good ?
Can you not do a viewScope.get("test") and then check the value of that?
 
Or you could maybe try containsKey("test") and this will return true if the viewScope has a mapping for the test key.
May 14, 2012, 9:59 AM
68 Posts
Re: viewScope - isEmpty don't work good ?
Resolved on my own:
 
try {
    viewScope.test1.values();
    // Working - Not empty
} catch(e) {
    // Not working - Empty
}

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