I am trying to use a FormItem as an ItemRenderer within a DataGroup - the purpose being to dynamically create a Form based upon an XMLlist as a data provider. The first part is a success in that the form items are successfully rendered, however my problem is that despite used the FormLayout in the DataGroup, my FormItem Labels are not aligning up with eachother.
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600"
>
<fx:Declarations>
<fx:XMLList id="_formModel" >
<control description="Weeks 1 Form Item" id="087B4626-B95E-731F-ACC7-80ED7373E083" label="One" />
<control description="Weeks 2 Form Item" id="AC546361-D9C5-E9F3-5F90-80EFA52EF54D" label="Second" />
<control description="Weeks 3 Form Item" id="9EE2AAA4-B9C3-68C0-D9B5-80F0374F940E" label="Three" />
<control description="Weeks 4 Form Item" id="3CCEABD6-12F9-E511-0C77-80F0A86902D5" label="The Fourth" />
</fx:XMLList>
<s:XMLListCollection id="_controls" source="{_formModel}"/>
</fx:Declarations>
<s:Scroller width="100%" height="100%">
<s:DataGroup width="100%" height="100%" dataProvider="{_controls}" >
<s:layout>
<s:FormLayout/>
</s:layout>
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:FormItem label="{data.@label}" width="100%" >
<s:TextInput width="100%" text="{data.@description}"/>
</s:FormItem>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:DataGroup>
</s:Scroller>
</s:Application>
Can anyone tell me how to align the form item labels whilst still using them within a Data Group as the purpose of the exercise is to create a form Dynamically based upon data fed into a DataGroup.
Thanks in advance.