5 Replies Latest reply on Apr 3, 2008 7:16 AM by Arty13

    2 DataProviders for one TileList?

    Arty13
      I have 2 different DataProviders (Array Collections) that I want to display in the same TileList.
      Is there a way to keep the 2 array collections unchanged and pass both to the TileList? Meaning I am using data binding with the two arraycollections and if I try to combine the 2 array collections into 1, it destroys my data binding.
      Any ideas?

      Thanks,

      Art
        • 1. Re: 2 DataProviders for one TileList?
          Doc816
          I would create a 3rd array collection and bind it to the tileList. Then setup a function to populate the 3rd array collection with data from the 1st and 2nd array collections.
          • 2. Re: 2 DataProviders for one TileList?
            Arty13 Level 1
            But by creating a 3rd array collection and joining the two, wont that destroy my data binding back to the original 2 array collections?
            • 3. Re: 2 DataProviders for one TileList?
              ntsiii Level 3
              What do you mean by "...data binding back to the original 2 array collections..."?

              You can only bind to one collection, and that binding is only one way, unless you code otherwise. If you mean you want to update the original ACs, then you could still do this by finding the correct item based on a key, and updating it from the value in the derived AC.

              Tracy
              • 4. Re: 2 DataProviders for one TileList?
                ntsiii Level 3
                By the way, what is the use case for this? Are you appending the two ACs? Or merging them on an item level, or what?
                Tracy
                • 5. Re: 2 DataProviders for one TileList?
                  Arty13 Level 1
                  I am merging them on an item level, more so I want them to appear they are merged on an item level.
                  Currently I am doing what you suggested and updating the original ACs by finding the correct item and updating it as neccesary. But by doing it that way I need to keep track of 10+ different states and it gets pretty messy and its not 100% done/correct so the user will see stale data and I cant have that. And a much easier way is to have each state use the same bounded ACs so then the flex framework will handle the changes in data and I wont get stale data shown to the user. It works perfectly when I only use one of the ACs, but I need to show both ACs in the list.
                  Thats my dilema.

                  Thanks,

                  Art