Search code examples
javascriptlistxpagesxpages-ssjs

List function in XPages


I would like to use the same function in XPages via Javascript.

Dim firstList List As Double
Dim secondList List As Double 

firstList("any")= 0 
firstList("many")= 2 
firstList("work")= 23 

Any suggestion is appreciated.
Regards
Cumhur Ata


Solution

  • Use a JavaScript object:

    Initialize object with

    var firstList = {any:0, many:2, work:23};
    

    or

    var firstList = {};
    firstList.any = 0;
    firstList.many = 2;
    firstList["work"] = 23;
    

    Get an entry value with

    var anyNumber = firstList.any;
    var manyNumber = firstList["many"];