Aejaz,

 

            What the error message is saying is that you have assigned two values to the TileList’s dataProvider property. The first place is the mxml attribute: <mx:TileList dataProvider=”{myQArr}” …>. The message also explains that the TileList’s default property is “dataProvider”. What this means is that if you place tags inside of the TileList and don’t specify which property they belong to, then it assigns the value to the default property (which is “dataProvider”). The FormItem inside of TileList is thus being assigned to TileList’s dataProvider property.

 

TileLists are not containers, so they can’t contain other components inside of it. You need to use an itemRenderer if you want to control the appearance of the individual items.

 

I’m assuming in this situation that you didn’t mean to have the FormItem inside of the TileLIst. Just remove it and you should be able to compile.

 

Jason

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of aejaz_98
Sent: Monday, June 19, 2006 7:16 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Flex2B3: Problem with a custom component & nested repeaters

 

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
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to