Based on this XPages adding @Formulas in dialogList, my dialogList1
takes values from two concatenated views: a
and b
.
There is another dialogList2
, which is rendered depending if the dialogList1
value is null or not, whose values should be like this:
dialogList1.value is from a => dialogList2.choices should be only from b
dialogList1.value is from b => dialogList2.choices should be only from a
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 the dialogList2 is taking values only from vwA ( from b ) ... I think I'm missing something. Thanks for your time.
Contr.txt_particontractcv_1
cannot be used in SSJS. Dot notation works in LotusScript but not SSJS or Java because Java's runtime is not proprietary and has not been extended that way. That is why Contr.getItemValueString("txt_particontractcv_1")
is required.
Some SSJS global variables allow dot notation to be used, e.g. sessionScope. But that is because it is based on a Map, so sessionScope.myProperty can only map to sessionScope.get("myProperty"). The Domino Document class does not extend the Map interface (that's one of the enhancements of the OpenNTF Domino API), so dot notation doesn't know whether to use getItemValue(), getItemValueString(), getItemValueDateTimeArray() etc.
This is also why best practice for scoped variables is also to use e.g. sessionScope.get("myVar"). When it comes to moving to Java, you will not be able to use dot notation, you will have to use the relevant method. So working that way in SSJS fosters good habits for the future.
Yep, I just modified Contr.txt_particontractcv_1
to Contr.getItemValueString("txt_particontractcv_1")
and, now, it works.`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With