2 Replies Latest reply on Jun 22, 2009 9:25 AM by yancaoshi

    How to detect value change of item?

    yancaoshi Level 1

      Hi all,

       

      We want to list all goods that customer chooses, so TileList is used to display all goods information and a custom component MyItem is used as ItemRenderer. Meanwhile a Label is used to display the sum of all the goods. The hierarchy is simply like this:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="absolute" >

      <mx:TileList id="tl" dataProvider="{acGoods}" ItemRenderer="MyItem"/>

      <mx:Label id="labelSum"/>
      </mx:Application>

       

      Here, acGoods is an ArrayCollection which I believe is bindable.

       

      User may change price inside MyItem directly, so the text of the Label need to update as well. I find that acGoods contains latest price. Now the problem is Label text stays the same. I have tried to call calculating function in set acGoods() but it doesn't work.

       

      Please don't sugguest dispatch event because this is only a simplified scenario. If anybody tell me how to implement this by binding mechaism, that'll be very helpful.

       

      Best wishes,