Filling non-Flex objects in a Repeat

Filling non-Flex objects in a Repeat

Hi guys,

For our current project were trying to put as much as possible of the display list structure into mxml. Because that’s more readable.
This of course also includes using Repeat’s for dynamical parts.

But, we build some parts in Flash. Just little peaces for skinning.
(We publish those as swc and use them in Flex)

We can’t of course just use this in flex, but we have the DisplayObjectWrapper from Mr. Grant to fix that.
But despite of this wrapper I can’t change the properties of non-Flex components within a Repeat, in mxml.

A simple example:

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas 
    xmlns:mx="http://www.adobe.com/2006/mxml" 
    xmlns:text="flash.text.*" 
    xmlns:ui="com.gskinner.ui.*">

    <mx:Script>
        <![CDATA[
            [Bindable]
            public var texts:Array = ["a","b","c"]
        ]]>
    </mx:Script>
    
    <mx:Repeater id="r" dataProvider="{texts}">
        <ui:DisplayObjectWrapper>
             <text:TextField text="{r.currentItem}" />
        </ui:DisplayObjectWrapper>
    </mx:Repeater>
    
    
</mx:Canvas> 

This gives the (compile) error:
“Unable to generate initialization code within Repeater, due to id or data binding on a component that is not a visual child.”

I went searching but couldn’t find much. Only that you can get this error if you use the DataGridColumn in a certain way in a Repeat.

Anyone any idea how to get this working?

Thnx