But remember that the repeater is meant to repeat MXML content at run time.
and this comes with a cost - getting down and dirty with binding and
collections. Not to mention that as a container. they sniff. Alternatives?

 

var xml:XML = <result>

                <book title="Book One"/>

                <book title="Book Two"/>

                <book title="Book Three"/>

                <book title="Book Four"/>

              </result>;

 

// Where you would pass group = "book" and the xml above.

private function createRadioGroup( group:String, xml:XML ):void

{

  for each ( var book:XML in xml.elements( group ) ) 

  {

    var rdo:RadioButton = new RadioButton();

    rdo.groupName = group;

    rdo.label = book.valueOf();

 

    // Where rdoGroup is an HBox

    rdoGroup.addChild( rdo );

  }                                            

}

 

Rick Winscot

 

 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Thursday, March 20, 2008 1:17 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Dynamic creation of radio buttons in a
radioButtonGroup

 

mx:Repeater.  You choose the container depending on the layout you want.

Tracy

  _____  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jeffreyr6915
Sent: Thursday, March 20, 2008 11:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Dynamic creation of radio buttons in a
radioButtonGroup

 

Is there a way to dynamically add new radio buttons to a
radioButtonGroup say from an xml file? I am looking for a similar
functionality to what I would receive if I were to use a dataprovider
for a comboBox (except I need to use radio buttons). Code samples are
appreciated. Thanks

 

<<image001.jpg>>

<<image002.jpg>>

Reply via email to