Again big pain to find the solution of this one. I was trying to create a MultiSelect declaratively, and the problem was I had to populate it programmatically.
Well it appears it isn’t as bad as it looks as long as you know that dojo data doesn’t apply to multiSelect. So the only thing you need is to add html options inside your widget. Mmmm
So the solution looks like that :
(removing divs because wordpress won't show them...)
div dojoType="dijit.form.MultiSelect" dojoAttachPoint="List"
And the code looks like this :
// Add each of the items
var c = dojo.doc.createElement(‘option’);
c.innerHTML = item.Name;
c.value = item.Value;
Simple no ?