3.0 beta 2

getElementById for CheckedList?

Hello,

I want to get the selected Items of a CheckedList. I create the CheckedLists dynamically:

for (var i = 2; i < trSettingName.cells.length; i++) {
   [...]
   var checkedList = new AW.UI.CheckedList;
   checkedList.setId('cmbDimension_ID' + i);
   checkedList.setItemText(arrItemText);
   checkedList.refresh();
}


How can I get the CheckedList object with something like the getElementById function, e.g.:

var checkedList = document.getElementById('cmbDimension_ID' + i);

alert(checkedList.getSelectedRows());


or something else

var checkedList = new AW.UI.CheckedList;
checkedList.getElementById('cmbDimension_ID' + i);
Alex
May 29,
I found the solution by myself on /datagrid.10734/getting-dynamically-created-grid-object.html

Maybe someone helps:

version 1

var obj = Active.System.all['mygrid']

Version 2
var obj = AW.object(id);

bad way:
x = eval('mygrid') 
theIndex = x.getSelectedIndex(); 
theId = x.getId();


getting the selected Item texts:
var ComboBox = AW.object('cmbDimension_ID' + intDimension_ID);
var SelItems = ComboBox.getSelectedItems();

[...]
for (var intSelItems = 0; intSelItems < SelItems.length; intSelItems++) {
  objCriteria.Values.push("'" + ComboBox.getItemValue(SelItems[intSelItems]) + "'"); 
}


I really like the activewidgets and this Forum. It's very helpful!
Alex
May 29,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.