开发者

Flex components property change event

开发者 https://www.devze.com 2023-01-18 03:40 出处:网络
I have a custom component on which I have bound an array collection to o开发者_运维问答ne of its proeprties:

I have a custom component on which I have bound an array collection to o开发者_运维问答ne of its proeprties:

<comp:MyComp id="comp" prop="{images}" />

images is an arraycollection

In the components' code I would like to know which event to listen on everytime images updates props.I tried a setter on props but the setter only gets called once when props is first set. I tried the collection event but I get "Update" events sent on top of 'add' and 'remove' events and I would rather not have to manage those. So is there an event(flex or otherwise) that is fired every time a component property is updated by a bindable property?


I think you want to listen to the collectionChange event on the prop property. This should fire every time an element in your ArrayCollection changes.

Be warned that changing the source of images not fire the collectionChange event, nor will it fire the prop setter.

0

精彩评论

暂无评论...
验证码 换一张
取 消