2 Replies Latest reply on May 1, 2007 3:35 PM by brado77

    Unable to generate initialization code within Repeater...

    ju2999
      Hello,

      I use a template component with inner mx-components within a repeater. The following error appears:

      "Unable to generate initialization code within Repeater, due to id or data binding on a component that is not a visual child. "

      If I use this component outside the repeater, everything works fine.

      Here is the code:

      <mx:Repeater ..>
      <komp:InnerPanel....>
      <komp:topContent>
      ...
      <mx:ComboBox dataProvider="{getUtils().monthNames}"/> <--- ERROR
      ...
      </komp:topContent>
      </komp:InnerPanel>
      </mx:Repeater>

      topContent is a UIComponent variable which is added to "this" of my template component.

      Can someone please explain to me, how to prevent this error?


      Edit: The innerPanel-template-component looks like this:

      <mx:Canvas creationComplete="initApp()" xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:Script>
      <![CDATA[
      import mx.core.UIComponent;
      public var topContent:UIComponent;

      public function initApp() : void {
      if (topContent != null) {
      innerPanel.addChild(topContent);
      }

      }

      ]]>
      </mx:Script>
      <mx:Panel id="innerPanel" />
      </mx:Canvas>