0

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));
ThomasH
  • 22,276
  • 13
  • 61
  • 62
Totty.js
  • 15,563
  • 31
  • 103
  • 175
  • 1
    Could you supply a working playground sample? Just tried to reproduce it and could not. Maybe I was missing something. – Martin Wittemann Jan 22 '13 at 07:12
  • I cannot reproduce my own error even un my code, now I've uncommented the removeAll method and it still works... I really cannot explain this right now, if it happens again I will make an example. Thanks for your time (: – Totty.js Jan 22 '13 at 14:32

0 Answers0