Title: Message
Agha,
 
This is from the Flex docs:
 

You cannot use a Repeater object to iterate through a two-dimensional Array object that is programmatically generated. This is because the elements of an Array object do not trigger changeEvent events, and therefore cannot function as binding sources at runtime. Binding copies initial values during instantiation after variables are declared in an <mx:Script> tag, but before initialize handlers are executed.

Jeff

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mehdi, Agha
Sent: Wednesday, August 17, 2005 1:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Repeater Question

Hi all,

Can someone please take a look at this code and tell me what am I doing wrong here?

=============================================================

<mx:Script>

<![CDATA[

        private var attributes : Array;

       

        private function loadAttributes() : Void

        {

                attributes = new Array();

               

                var attribute : Object = new Object();

                attribute["name"] = "Density";

                attribute["rows"] = new Array();

                attribute["rows"][0] = new Array();

                attribute["rows"][0][0] = "8 MB";

                attribute["rows"][0][1] = "4 MB";

                attribute["rows"][0][2] = "9 MB";

                attribute["rows"][1] = new Array();

                attribute["rows"][1][0] = "18 MB";

                attributes.push( attribute );

               

                var attribute : Object = new Object();

                attribute["name"] = "I/O Voltage";

                attribute["rows"] = new Array();

                attribute["rows"][0] = new Array();

                attribute["rows"][0][0] = "3.3 V";

                attribute["rows"][0][1] = "4.5 V";

                attributes.push( attribute );

        }

]]>

</mx:Script>

       

<mx:Repeater id="attributes_rpt" dataProvider="{attributes}">

        <mx:FormItem width="100%">

                <mx:CheckBox id="column1" label="{attributes_rpt.currentItem['name']}"/>

                <mx:FormItem enabled="{column1.selected}" marginLeft="20">

                        <mx:Repeater id="attributeRows_rpt" dataProvider="{attributes_rpt.currentItem['rows']}">

                                <mx:HBox>

                                        <mx:Repeater id="attributeValues_rpt" dataProvider="{attributeRows_rpt}">

                                                <mx:CheckBox label="" width="80" toolTip=""/>

                                        </mx:Repeater>

                                </mx:HBox>

                        </mx:Repeater>

                </mx:FormItem>

        </mx:FormItem>

</mx:Repeater>

===========================================================================

The problem is that it doesn't work. I call the function on initialize event of mx:Application tag.


Thanks

Agha Mehdi

IDT - eBusiness Program Manager

Work: 408.284.8239

Fax:   408.284.2766



--
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
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




Reply via email to