I have an array of objects I would like to use in a repeater component. One of the fields in the objects refers to the id of a component defined in the
<fx
eclarations> tag.
Trouble is, I have no clue how to get it to display:
ActionScript Code:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:ns1="*"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">
<fx:Declarations>
<ns1:CustomOne id="foo" />
<ns1:CustomTwo id="bar" />
<ns1:CustomThree id="snafu" />
</fx:Declarations>
<fx:Script>
<![CDATA[
[Bindable] public var modules:Array;
public function init():void {
modules = [
{module:foo, label:"Foo"},
{module:bar, label:"Bar"},
{module:snafu, label:"Snafu"},
];
}
]]>
</fx:Script>
<mx:TabNavigator>
<mx:Repeater id="tabs" dataProvider="{modules}">
<s:NavigatorContent label="{tabs.currentItem.label}" >
{tabs.currentItem.module}
</s:NavigatorContent>
</mx:Repeater>
</mx:TabNavigator>
</s:Group>
I tried using NavigatorContent.contentGroup too but nothing happened.
Suggestions?