I think you need the Bindable meta tag on the set function of the getter
and setter. i'm not in front of flash builder to test though...


On 18 November 2013 16:57, mark goldin <[email protected]> wrote:

> 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
>

Reply via email to