1 Reply Latest reply on Nov 25, 2007 3:24 AM by mrs_kariem

    DataService.fill() to ArrayCollection using SQL Assembler fills with null objects


      I have a problem (bug?) using the DataService.fill() method on the results of an SQL Query, using flex.data.assemblers.SQLAssembler

      I have mimicked the SQL Assembler demonstration application that comes as part of Samples with LifeCycle DS.
      I have altered data-management-config.xml to match my Oracle connection, the table, and also modified the SQL query.

      In the View, an ArrayCollection is populated using the DataService.fill() method as:


      f.fill(collection, 'all');



      <mx:ArrayCollection id="collection"/>
      <mx:DataService id="f" destination="my-destination" />

      The XML file is set up correctly, connects to the database and the Flex logger shows that a SequencedMessage Object is populated as an Array of about 100 items, as expected. You can also see the individual array items being populated.
      However, at the view the ArrayCollection grows in length to 100 but all of its items are null.

      Debugging my simple application and stepping through, some very strange behaviour occurs...
      When the fill() method is called the Collection is populated with the first 3 dataitems, that is [0] [1] and [2] however the value of [0] is actually the value of [4].
      In the next step, [0] is set to null and the value of [4] is populated.
      Then [1] is set to null and [5] is populated, etc
      This whole process repeats itself until the Collection grows to length 100 and all items get set to null!

      The strange thing is that I am filling two Collections via two separate DataServices (in fact they are connecting to two different databases).
      The first one populates the Collection properly, but the second one behaves in this way!

      Any help would be greatly appreciated!

        • 1. Re: DataService.fill() to ArrayCollection using SQL Assembler fills with null objects
          Hi Mr. st9_flex

          I am not professional like you, so I don't have the answer about your question. But What you done I want to do. I want to make a connection between Flex and Oracle to read data from the tables, write it into an xml file, then make the flex read from that xml. I know the strategy but I don't know what I have to write in the code. Could you please give me an example of how I can do that by write the code, the location of those files and the programs that I have to download ??

          Please Help me I need your help and remeber when you help somebody God will help you.

          I am waiting your reply. Thanks