1 Reply Latest reply on Nov 15, 2007 1:08 PM by ntsiii

    Repeater Qs

    trycold Level 1

      Basically what I want to do is that I have a component like following:

      <mx:HBox width="100%">
      <mx:TextInput id="Description" />
      <mx:TextInput id="Quantity" />
      <mx:TextInput id="UnitCost" />
      <mx:TextInput id="TotalCost" text="{int(Quantity.text) * int(UnitCost.text)}" />

      I want these rows and which is dynamic based on how many the user wants. So if they click next one more row should be added and then the whole data I need to put in a databse

      I tried putting this in a repeater because I thought that i can acess the dataprovider and can insert into the database.

      <mx:Repeater id="itemRepeater" dataProvider="{myAC}">
      <view:CalculateCost id="calculateCost" costItem="{itemRepeater.currentItem}" />

      where arrItem = new Array( {Line:"",Description:"",Quantity:"",UnitCost:"",CalCost:""} );

      <mx:ArrayCollection id="myAC" source="{arrItem}"/>

      how do I update this array everytime the user hits next so that it creates one more row and how can i access the whole data.