On 12/9/16, 12:02 PM, "[email protected] on behalf of Carlos Rovira"
<[email protected] on behalf of [email protected]> wrote:
>Hi Alex, I think I don't need to dispatch a "dataChange" event, I only
>want
>to ease writing.
If you use [Bindable("dataChange")] the code must call dispatchEvent
itself. The compiler does not generate any code for that. If you just
use [Bindable] then the compiler will generate the dispatchEvent.
>
>I think this should work:
>
> [Bindable]
> public function get product():ProductVO
> {
> return data as ProductVO;
> }
As written above it can't work because there is no setter to call
dispatchEvent.
IMO, the best you can do is:
[Bindable("dataChange")]
public function get product():ProductVO
{
return data as ProductVO;
}
By not overriding the data setter, when the data is set, a dataChange will
fire and the binding subsystem will think product changed as well. It
might not work today. I will try it out and get it to work.
Thanks,
-Alex