Skip to main content link. Accesskey S

XPages Wiki

Submit Search

YouAtNotes XPages Wiki


Home > Server JavaScript > Work with scoped variables

Work with scoped variables

ShowTable of Contents

Place data into a variable


sessionScope.put("key", "some string value");
var a = new Array();
a.push("value1");
a.push("value2");
sessionScope.put("anotherkey", a);

Get data


var v = sessionscope.get("key");

Scope types

applicationScope


Are visible for all users of one application. Expires some time after the last user used an applicationScope variable.
That means applicationScope variables are NOT persistent forever. But they can be used for caching stuff for all users.

sessionScope


Is valid through the session of the current user. A user session expires after some time of inactivity. Uses don't have access to the sessionScope variables of other users.

requestScope


Is valid through one request of the current user. That includes refreshing of a page.

viewScope


Is visible for views on the current page only. Useful for transporting a search query to a view.
See what's possible with Xpages.
Have a look at our ServiceCommunicator website
and the YouAtNotes Support.
Use  searchlotus.com  for news in the Web related to Lotus Notes and Domino,
and to search those sites.
Check  youatnotes.com  for great Lotus Notes, Domino and XPages software.
Did this wiki help you?
Did this saved you time? Express your gratitude by making a donation:
PayPal - The safer, easier way to pay online!