mardi 28 avril 2015

Ember "select" view with 'multiple=true': underlying controller property is always 'undefined'

Ember 1.10.0 with Ember CLI 0.2.0-beta.1

I have encountered a problem with the standard "select" view (which represents an HTML drop-down list):

When the 'multiple=true' setting is applied to the view (so, the view represents an HTML drop-down list where multiple elements can be selected) I am getting the underlying controller property always having the 'undefined' value. This happens independently on the drop-down selection: either when no element is selected or just one element or multiple elements. Looks like there is no synchronization between the drop-down and corresponding controller at all.

The same with default drop-down selections (which can be set via the underlying controller property, as I know): I tried null, [], {} and some pre-selections like [1, 2]. That is not being taken into consideration at all!

The view definition in a Handlebars template:

{{view 'select'
  content=model.dictDestinations
  value=selectedDestination
  optionValuePath='content.id'
  optionLabelPath='content.name'
  multiple=true
  classNames='form-control'
}}

When the drop-down is a single-selection (no 'multiple=true' setting for the "select" view) then everything is fine.

Has anybody seen anything similar? What am I doing wrong? Or this is a bug in Ember?

Thank you!




Aucun commentaire:

Enregistrer un commentaire