get the unid of selected documents and save to scoped variable

后端 未结 3 1062
南笙
南笙 2021-01-27 23:23

I\'ve a viewPanel1 with checkboxes. By clicking on a button I would like to save the univ id\'s (comma seperated) of the selected items to a scoped variable. I tried this :

3条回答
  •  不知归路
    2021-01-28 00:05

    var viewPanel=getComponent("viewPanel1");
    var docIDArray=viewPanel.getSelectedIds();
    var unidArray = new Array();
    for(i=0; i < docIDArray.length; i++) {
       var unid=database.getDocumentByID(docIDArray[i]).getUniversalID();
       unidArray.push(unid);
    }
    sessionScope.put("test", @Implode(unidArray, ","));
    

    This will probably do it.

提交回复
热议问题