Hi All,
I am having a problem with nested Repeater controls not refreshing properly to 
reflect the data that is bound to the data provider for each of the Repeater 
controls. My problem is related to the following:
 
I have two classes, say Parent and Child which are as follows:
 
[Bindable]
public class Parent {
  public var children : ArrayCollection = new ArrayCollection();
}
 
[Bindable]
public class Child {
  public var name : String = “foo”;
  public var isEnabled : Boolean = true;
  public var isSelected : Boolean = false;
  public var enabledChildren : ArrayCollection = …;
  public var disabledChildren : ArrayCollection = …;
}
 
The enabledChildren and disabledChildren collections contain references to 
other Child objects that exist within the children collection of another parent.
 
Then I have the following nested Repeater control structure:
 
<mx:Repeater id="parentRepeater" dataProvider="{model.parents}">
<mx:Repeater id="childRepeater" dataProvider="{ 
parentRepeater.currentItem.options}"> 
            <mx:CheckBox label="{childRepeater.currentItem.name}" 
                         enabled="{childRepeater.currentItem.isEnabled}"
                         selected="{childRepeater.currentItem.isSelected}" 
                         click="optionClicked(event);" />
      </mx:Repeater>
</mx:Repeater>
 
Where model.parents references an ArrayCollection of Parent objects.
 
The problem that I am having is that when a checkbox is clicked, the 
optionClicked function is called, and within this function there is logic that 
iterates over the enabledChildren and disabledChildren collections of the Child 
object bound to the clicked checkbox, and it sets the isEnabled and isSelected 
properties of each Child object in these collections to either true or false, 
depending on the current state of the checkbox that was clicked.
 
However, when I do this, the checkbox controls are not updated properly, as the 
enabled and/or selected state of the checkbox does not accurately reflect the 
value that is stored in the object that is bound to this control.
 
The only way that I am able to have the checkboxes redraw properly is to do a 
manual refresh on the model.parents collection, but doing so causes the view to 
flicker pretty noticeably.
 
Is there any way to perform this type of operation and have all of the controls 
update properly without having to do the manual refresh? I know that the data 
that is bound to the controls is being updated properly, but the actual view of 
the controls is not being updated.
 
Any help that could be offered on this matter would be greatly appreciated.


      Ask a question on any topic and get answers from real people. Go to 
Yahoo! Answers and share what you know at http://ca.answers.yahoo.com

Reply via email to