0 Replies Latest reply on Oct 15, 2011 3:45 AM by yadavalli vidyasagar

    Problem in accessing array collection inside another array collection

    yadavalli vidyasagar

      Hi,

       

           I am new to Adobe Flex and i have a requirement as follows:

                

                     I have an ArrayCollection in which i am trying to add another ArrayCollection(2nd) by populating  the 2nd array collection. While Retrieving the data from 2nd ArrayCollection Using the First ArrayCollection i am facing a problem and I could not retrieve the data properly . The Following code

       

      Action Script Class:

       

      public

      class SourceOfsupplyClass

      {

       

      public var prefSupplier:String;

       

      public var supplier:String;

       

      public var supplierName:String;

       

      public var contractNo:String;

       

      public var deliveryDate:String;

       

      public var location:String;

       

      public var supplierContractsArr:ArrayCollection=new ArrayCollection(); (2nd Array Collection)

      }

       

      <<Code>>

       

      While Retrieving

       

       

      public

      function check():void{

       

      for

      (var i:int=0;i<cartItemsArr.length;i++){

      Alert.show(Application.application.SourceOfSupplyLocal[i].supplierContractsArr.length.toSt ring());      // Here SourceOfSupplyLocal is Ist ArrayCollection

       

      }

      While running the application I am getting following result:

       

      Expected Result : 2nd Array collection length for index 0 is 0 and for index 1 is 1

       

      Actual result: but we are getting latest index array length for all the indices  means for index 0 and 1 both we are getting length as 1.

       

      Please reply to this post.

       

      Thank You

       

      Vidyasagar Y