BindingUtils.bindProperty(combobox, "comboValue", model, "field", true);
Here is my relative combobox code:
private var _comboValue:*;
public function set comboValue(value:*):void
{
// simplified
for each (var listItem:* in dataProvider){ if (listItem.value] ==
_comboValue){ selectedItem = listItem; break; } }
}
[Bindable]
public function get comboValue():*
{
return _comboValue;
}
addEventListener(IndexChangeEvent.CHANGING, onChange, false, 0, true);
private function onChange(event:IndexChangeEvent):void
{
if (selectedIndex > -1)
comboValue = selectedItem.value;
else // new item
{
var _item:Object = new Object();
_item.value = textInput.text;
comboValue = _item.value;
ArrayCollection(dataProvider).addItemAt(_item, 0);
}
}
When I add a new item the underlying model is not getting the new value and
I have to manually assign to it:
model.field = combobox.selectedItem["value"];
Any idea?
Thanks