xpages adding @formula in list

不打扰是莪最后的温柔 提交于 2019-12-12 14:44:46

问题


There is a client notes application and in its main form, there is a dialogList having this formula: ( C21331:312321C is, actually, the replica ID, in this example it's just a random number )

_view := "vw1";
_vieww :="vw1";



x :=@Sort(@Unique ( @DbColumn( "" : "NoCache" ; C21331:312321C; _view; 1 ) );[Ascending]);
y :=@Unique ( @DbColumn( "" : "NoCache" ; @DbName ; _vieww ; 1));

y:x

How to use thee above code in my combobox computed values? I tried:

    var _view = "vw1";
    var _vieww= "vw2"; 

    db = new Array(@Sort(@Unique ( @DbColumn( "" : "NoCache" , C21331:312321C, _view, 1 ) );[Ascending]);

    db1 = new Array(@Unique ( @DbColumn( "" : "NoCache" ; @DbName ; _vieww ; 1)));

   db:db1 

How can I achieve this functionalty in xpages? Thanks for your time.


回答1:


Use .sort() to sort an array (@Sort is not implemented in SSJS) and .concat() to concatenate two arrays or an array and a string:

var a = [].concat(@Unique(@DbColumn( ... ))).sort();
var b = @Unique(@DbColumn( ... ));
return a.concat(b);


来源:https://stackoverflow.com/questions/25662631/xpages-adding-formula-in-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!