Quantcast

SelectBox and getModelSelection

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SelectBox and getModelSelection

Daniel Lenggenhager
Hi all,

I've an error, when I try to reload a select box and remember the selected model (to reselect after reloading).
Error: Could only select one item, but the selection array contains 2 items!

Have I missed something? - Thanks for the help.

Example:
http://tinyurl.com/h4msy76

Regards,
Daniel

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SelectBox and getModelSelection

rsantiagopaz
  var modelSelection = (selectBox.isSelectionEmpty()) ? 2 : selectBox.getModelSelection().getItem(0);
  selectBox.removeAll();
  [{ID: 1, name: 'Test ' + Math.random()},{ID: 2, name: 'Test ' + Math.random()},{ID: 3, name: 'Test ' + Math.random()}].forEach(function(item){
    selectBox.add(new qx.ui.form.ListItem(item.name, null, item.ID));
  },this);
  selectBox.setModelSelection([modelSelection]);


regards
Loading...