So, I'm using a Repeater in a Flex 3 app.  I hope to eventually refactor it as 
a custom component so I can have a little more control over its behavior; 
however, for now I'm trying to fix one problem with the existing application.

The data model is an ArrayCollection of RoomVOs, with each RoomVO having an 
ArrayCollection of PeopleVOs.  I'm using a repeater to display each room inside 
of a Panel.

I have something similar to the following:

<mx:Repeater id="roomRepeater" dataProvider="{model.rooms}">
  <mx:VBox>

  <mx:DataGrid
    dataProvider="{roomRepeater.currentItem.assignedPeople}">
  
     <!-- column details omitted -->

  </mx:DataGrid>

  <mx:Label text="Room Count: 
    {roomRepeater.currentItem.assignedPeople.length}" />                        
                                

  </mx:VBox>
</mx:Repeater>

The problem occurs when I update the model in response to an event.  When the 
assignedPeople ArrayCollection has an item added the DataGrid that's bound to 
it is updated, but the Label is only updated intermittently.  I am not able to 
come up with a pattern as to when the Label will get updated.

If I call model.rooms.refresh() the repeater re-executes and of course 
everything is then updated correctly.

I've even created debug buttons inside the repeater such as: 
  <mx:Button id="lenBtn"
    
click="RoomVO(event.currentTarget.getRepeaterItem()).assignedPeople.length);"
  />

When I click this button is displays the correct length of the assignedPeople 
AC even though the label is not updated.

Any ideas?

Thanks in advance,
Seth Stone




Reply via email to