I changed
the second repeater to a TileList as follows,
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" xmlns:ns1="components.*">
<mx:Script>
<![CDATA[
[Bindable]
public var
myArray:Array=["A","B","C","D"];
[Bindable]
public var myQArray:Array=[{label:"A"}];
]]>
</mx:Script>
<mx:ArrayCollection id="myAC"
source="{myArray}"/>
<mx:ArrayCollection id="myQArr"
source="{myQArray}"/>
<mx:Accordion id="accordion" x="139"
y="303" width="200" height="200">
<mx:Repeater id="myrep"
dataProvider="{myAC}">
<ns1:QuestionForm
label="{myrep.currentItem}" width="199"
height="178">
&nb! sp; <mx:TileList dataProvider="{myQArr}"
maxColumns="1" >
<mx:FormItem label="">
<mx:Button label="Inner"/>
</mx:FormItem>
</mx:TileList>
<mx:FormItem
label="">
<mx:Button label="Outer"/>
</mx:FormItem>
</ns1:QuestionForm>
</mx:Repeater>
! </mx:Accordion>
</mx:Application>
N! ow I get the compilation error : Multiple
initializers for property 'dataProvider'. (note: 'dataProvider' is the default
property of 'mx.controls.TileList').
Please let me know why is it taking the dataProvider for the repeater ?
Thanks,
Aejaz
--- In flexcoders@yahoogroups.com,
"aejaz_98" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have the following application,
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="absolute" xmlns:ns1="components.*">
> <mx:Script>
> <![CDATA[
> [Bindable]
> public var
myArray:Array=["A","B","C","D"];
> [Bindable]
> public var myQArray:Array=["A"];
> ]]>
> </mx:Script>
> <mx:ArrayCollection id="myAC"
source="{myArray}"/>
> <mx:ArrayCollection id="! myQArr"
source="{myQArray}"/>
> <mx:Accordion id="accordion" x="139"
y="303" width="200"
> height="200">
> <mx:Repeater id="myrep" dataProvider="{myAC}">
> <ns1:QuestionForm label="{myrep.currentItem}"
width="199"
> height="178">
> <mx:Repeater id="myrep2"
dataProvider="{myQArr}">
> <mx:FormItem label="">
> <mx:Button label="Inner"/>
> </mx:FormItem>
> </mx:Repeater>
> <mx:FormItem label="">
> <mx:Button label="Outer"/>
> </mx:FormItem>
> </ns1:QuestionForm>
> </mx:Repeater>
> </mx:Accordion>
> </mx:Application>
>
> QuestionForm is a custom component defined as follows,
>
> <?xm! l version="1.0" encoding="utf-8"?>
> <mx:Form xmln! s:mx="ht tp://www.adobe.com/2006/mxml">
> <mx:Script>
> public var categoryID:Number;
> </mx:Script>
> </mx:Form>
>
> </mx:Application>
>
> When I run this application, Flash gives the following Exception & the
> application fails to load. However, if I change QuestionForm to Form,
> the application runs fine. Please let me know what is missing here.
>
> TypeError: Error #1034: Type Coercion failed: cannot convert
> mx.core::[EMAIL PROTECTED] to Array.
> at mx.core::UIComponent/createReferenceOnParentDocument()
> at mx.core::Container/createComponentFromDescriptor()
> at mx.core::Container/createComponentsFromDescriptors()
> at mx.containers::Accordion/::instantiateSelectedChild()
> at mx.containers::Accordion/::commitSelectedIndex()
> at
> mx.containers::Accordion/mx.containers:A! ccordion::commitProperties()
> at mx.core::UIComponent/validateProperties()
> at mx.managers::LayoutManager/::validateProperties()
> at mx.managers::LayoutManager/::doPhasedInstantiation()
> at mx.core::UIComponent/::callLaterDispatcher2()
> at mx.core::UIComponent/::callLaterDispatcher()
>
>
>
>
> Thanks,
> Aejaz
>