Tom,

It sounds like you are changing the contents of configArray? The
ArrayCollection will not notice if you manipulate the underlying Array after
the ArrayCollection has been created. You can either manipulate the
ArrayCollection directly, or reset the source property on the
ArrayCollection after you have changed the Array. Calling refresh() on the
ArrayCollection does not fix the problem.

For example, this works:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
    <mx:Script>
        <![CDATA[
            [Bindable]
            protected var a:Array = [];
        ]]>
    </mx:Script>
    <mx:creationComplete>
        <![CDATA[
            a.push({a:"one"});
            ac.source = ac.source; // reassign the source property to
trigger a reset
        ]]>
    </mx:creationComplete>
    <mx:ArrayCollection id="ac" source="{a}"/>
    <mx:DataGrid dataProvider="{ac}"/>
</mx:Application>

-Jonathan
http://jonathanbranam.net - Flex 3 Anatomy and Solutions


On Thu, Jun 26, 2008 at 10:31 AM, Tom McNeer <[EMAIL PROTECTED]> wrote:

>   I need to have a repeater iterate over an array, displaying an instance
> of a custom component for each iteration.
>
> However, for testing, I am simply attempting to output a button with a
> static label within the repeater.
>
> Here's the basic code on the repeater:
>
>
>     <mx:ArrayCollection id="configAC" source="{estimate.configArray}"/>
>     <mx:VBox width="100%" id="configDisplay">
>         <mx:Repeater dataProvider="{configAC}" id="configRepeater">
>             <mx:Button label="D'oh" />
>         </mx:Repeater>
>     </mx:VBox>
>
> Setting a breakpoint after the array is populated, I can see that:
>
> a) the original array (estimate.configArray) is populated with a single
> member, a custom ActionScript object. Length is 1, there is an object of the
> correct type at position 0.
> b) the array collection with the original array as source (configAC) shows
> the same contents.
> c) the dataprovider on the repeater, which is the array collection, shows
> the correction contents, an AC with a length of 1.
> d) the currentItem in the repeater shows the correct object from the AC.
>
> Yet the contents of the repeater, which should just be a simple button, do
> not display.
>
> I'm mystified. So I must be missing something simple.
>
>
> --
> Thanks,
>
> Tom
>
> Tom McNeer
> MediumCool
> http://www.mediumcool.com
> 1735 Johnson Road NE
> Atlanta, GA 30306
> 404.589.0560
>  
>

Reply via email to