I got this demo from the Ember documentation. It is a select-box with a value assigned.
App.programmers = [
Ember.Object.create({firstName: "Yehuda", id: 1}),
Ember.Object.create({firstName: "Tom", id: 2})
];
App.currentProgrammer = Ember.Object.create({
id: 2
});
View:
{{view Ember.Select
contentBinding="App.programmers"
optionValuePath="content.id"
optionLabelPath="content.firstName"
valueBinding="App.currentProgrammer.id"}}
This case works and the "Tom"-item is selected.
When I add the attribute: multiple="true" to the Ember.Select, the "Tom"-item is still selected. But I want that multiple items already are selected, so I changed App.currentProgrammer to this:
App.currentProgrammer = [
Ember.Object.create({id: 1}),
Ember.Object.create({id: 2})
];
But now nothing is selected anymore. Should I change the valueBinding-attribute?