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 :
What you could do is the following
var vPanel = getComponent("viewPanel");
docIdArray = viewPanel.getSelectedIds();
sessionScope.put("SelectedIds",@Implode(docIdArray,","));
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.
Also, don't forget that scoped variables can hold an array, so you don't really need to box/unbox the array:
sessionScope.put("SelectedIds", getComponent("viewPanel1").getSelectedIds());