Title: Message

Hi Mark,

 

Try this à

 

<mx:Accordion id="inputDetail" height="100%" width="100%"

            creationComplete="addStuff(query.input)">

 

            import mx.controls.Label;

            import mx.controls.TextArea; 

            import mx.controls.VBox;

 

function addStuff(elements) {
    var count:Number = elements.length;
    for (var i=0; i<count; i++) {
        var element:String = elements[i].name;

        var type:String = elements[i].type;

 

        var vbox = VBox(inputDetail.createSegment(VBox, element, element, undefined));

 

        var newLabel = Label(vbox.createChild(Label, undefined, "Some Data")); 

    }

}

 

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark Wales
Sent: Wednesday, October 05, 2005 12:20 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Creating Children in a Dynamic Accordion

 

Hello,

 

I am trying to dynamically/conditionally add children to a set of dynamically/conditionally created Accordion segments.

 

At present, I create the segments I want using a loop over my array:

 

 <mx:Accordion id="inputDetail" height="100%" width="100%"

            creationComplete="addStuff(query.input)">

function addStuff(elements) {
    var count:Number = elements.length;
    for (var i=0; i<count; i++) {
        var element:String = elements[i].name;

        var type:String = elements[i].type;

 

        var vbox = inputDetail.createSegment(mx.containers.VBox, element, element, undefined);

 

        var newLabel = vbox.createChild(mx.controls.Label, undefined, "Some Data"); 

    }

}

 

The createChild function does not yield any results. Does anyone have any suggestions?

 

Thanks,

 

-Mark

 

 




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




YAHOO! GROUPS LINKS




Reply via email to