开发者

Flex components property change event

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜