0 Replies Latest reply on Feb 28, 2012 2:42 PM by John Hall

    Binding of an ArrayCollection's members that are nested inside another class

    John Hall Level 4

      A general question about binding and updating. Building a sports app and I have a list of teams, which is an arrayCollection.

       

      For the venues, a currentVenue and it has associated home teams, which is an arrayCollection.  So I have

       

      teams  ArrayCollection

      venue.getItemAt(i).homeTeams another ArrayCollection which contains references to the teams

       

      When I change a team name and refresh the teams dataProvider, I would have thought that the update would ripple down to the ArrayCollection of teams in venue.getItemAt(i).homeTeams but it still refers to the old team name. So the general question is if I have an arrayCollection and it is an property inside of another class, and it's members are updated, do I literally have to go into the venue.homeTeams ArrayCollection and iterate over all the homeTeams arrayCollection to expect it to update?

       

      I hope that's not too convoluted of a way of asking the question but I'm sure it comes up in other circumstances when people update a member of one class and that class is part of a collection contained inside another class. My concept of binding doesn't hold true. Explanations so I can understand the principle?

       

      It's not that I can't make it work by iterating but it just feels clumsy and I might be missing a basic principle.