I get this error when I try to remove all the elements in the array, which is the model for the selection Box. From what I understand this happens because I have the first row selected and I remove all items, in order to replace them again. The how should I do this to work?
// is only created the first time
weeks: new qx.data.Array()
// every time I change the year I have to
weeks.deleteAll();
// for each week in the year add the week
weeks.push(qx.data.marshal.Json.createModel({
label: "week: " + weeksNum
,fromDay: week.startDay
,toDay: week.endDay
}));
// the view
var weeksSelectBox = new qx.ui.form.SelectBox();
var weeksController = new qx.data.controller.List(this.__headerData.weeks, weeksSelectBox, 'label');
content.add(weeksSelectBox);
weeksSelectBox.addListener("changeSelection", function(e) {
var selectedItem = e.getData()[0];
var model = null;
if(selectedItem){
model = selectedItem.getModel()
}
this.__component.onWeekSelected(model);
}.bind(this));