Xpages @IsMember function in dialog list item values

Based on this XPages adding @Formulas to dialogList , my dialogList1 takes values ​​from two concatenated views: a and b .

There is another dialogList2 , which is rendered depending on if the value of dialogList1 is null or not, the values ​​of which should be like this:

dialogList1.value from a => dialogList2.choices should only be from b

dialogList1.value from b => dialogList2.choices should only be from

I tried:

 // Contr.txt_particontractcv_1 - is the value binded by dialogList1 var dbname = session.getServerName() + "!!" + "mynsf.nsf"; //var a = @Unique(@DbColumn(dbname, "vwNumeCompanii", 0)).sort(); //var b = @Unique(@DbColumn(@DbName(),"vwA",0)); //return a.concat(b); if ( @IsMember(Contr.txt_particontractcv_1,@Unique(@DbColumn(@DbName(),"vwA",0)))) { return @Unique(@DbColumn(dbname, "vwNumeCompanii", 0)) } else { return @Unique(@DbColumn(@DbName(),"vwA",0)) } 

but dialogList2 only accepts values ​​from vwA (from b) ... I think I'm missing something. Thank you for your time.

+5
source share
2 answers

Yes, I just changed Contr.txt_particontractcv_1 to Contr.getItemValueString("txt_particontractcv_1") and it works now. `

+2
source

Contr.txt_particontractcv_1 cannot be used in SSJS. Dot notation works in LotusScript, but not in SSJS or Java, because Java runtime is not patented and has not been extended in this way. Therefore, Contr.getItemValueString("txt_particontractcv_1") is required.

Some global SSJS variables allow you to use dot notation, for example. sessionScope. But this is because it is based on a map, therefore sessionScope.myProperty can only be displayed on sessionScope.get ("myProperty"). The Domino Document class does not extend the map interface (this is one of the Domino OpenNTF API enhancements), so the point notation does not know whether to use getItemValue (), getItemValueString (), getItemValueDateTimeArray (), etc.

In addition, it is recommended that you use best practice for variables with scope, for example. sessionScope.get ("MYVAR"). When it comes to switching to Java, you won’t be able to use dotted notation; you will have to use the appropriate method. Thus, working in this way in SSJS promotes good habits in the future.

+3
source

Source: https://habr.com/ru/post/1201810/


All Articles