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



Aug 7, 2013, 9:23 AM
12 Posts

variables in computedfields(public or private ?)

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 9.0
  • Role: Developer
  • Tags: ssjs,public,private,type
  • Replies: 1

Hi,

I am trying to unterstand what type of data variables defined in a computed field ( or any ssjs code) are.

If i define a variable in ssjs "var docid:String = ...." i could use the variable in every ssjs code on the page (i think i am right).

Is the variable comparable to an application or a session scope variable ? Whats about the performance ?

 

Are there any advantages or disadvantages of defining variables in ssjs and use it on the complete website ?

Best Regards

Aug 7, 2013, 1:39 PM
93 Posts
Myself

I myself regularly use view and session scope variables.

 

Depending on the variable use depends on the best scope to use. Hopefully this might be of use

 

requestScope
This only last for a single request. Object is a Map (lookup with a key) so you can add your own values but you need to make sure you don’t overwrite existing values.
viewScope
Setup variables that exist for the life time of the associated view (Xpage). Only visible to the current user. Lost as soon as you move to a different page.
sessionScope
These last as long as the user’s session is active (lost if you rebuild the application). Only visible to the current user and exist between all pages
applicationScope
Available to all users and are available while the application is in server memory. Good for global settings where the same parameter should be used by all

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