Try this?

Don't do createchild for the myGroup, just do 
myVbox["radioGroup"+myField.id+editable] = new RadioButtonGroup();

Matt

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Barrau 
Antoine
Sent: Tuesday, February 14, 2006 6:08 AM
To: [email protected]
Subject: [flexcoders] Problems with dynamically generating radio button in a 
radiobutton group

Hi,
i try to generate dynamic forms using a xml file.
i have a problem with generating dynamic radio button.

when i create a radioButtonGroup and several radio
button having the groupName property set to the name
of the previously radioButtonGroup, i can't manage to
get the "change" or "click" event of the
radioButtonGroup to be triggered.
Here is a piece of my code, where i create the radio
button group.

Anyone see anything wrong here?

var myGroup =
myVbox.createChild(mx.controls.RadioButtonGroup,"radioGroup"+myField.id+editable);
myGroup.addEventListener("click",mx.utils.Delegate.create(this,function():Void{
         Dumper.trace("click event triggered");
         }));
myGroup.addEventListener("change",mx.utils.Delegate.create(this,function():Void{
         Dumper.trace("change event triggered );
         }));
        
                                
var radioButtonArray = new Array();
if (myField.option.length!=undefined)
{
radioButtonArray = myField.option;
}
else
{
radioButtonArray.push(myField.option);
}

for (var
radioCounter=0;radioCounter<radioButtonArray.length;radioCounter++)
{
 var myRadioButton = radioButtonArray[radioCounter];
 var selected:Boolean = false;
 if (radioCounter==0) selected=true;
 var myButton =
myVbox.createChild(mx.controls.RadioButton,"radioButton"+myRadioButton.value,{label:myRadioButton.label,styleName:"label",value:myRadioButton.value,selected:selected,groupName:"radioGroup"+myField.id+editable});
}


Thanks a lot,

Antoine




        

        
                
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs 
exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com


--
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



 





--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to