Here is a basic example of dynamic control creation.

http://www.cflex.net/showFileDetails.cfm?ObjectID=562

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of joel.sisko
Sent: Wednesday, April 08, 2009 10:13 PM
To: [email protected]
Subject: [flexcoders] Populate panel controls based on radiobutton
clicked....

 






I am new to programming and Flex. I have Panel in my application that I want
to populate with controls based on the specific radio button that is
clicked.
What is a good way to do this based on the code below:

#######Begin code#######

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.
<http://blog.flexexamples.com/2008/06/21/detecting-when-a-radiobutton-has-be
en-clicked-in-a-radiobuttongroup-in-flex/>
flexexamples.com/2008/06/21/detecting-when-a-radiobutton-has-been-clicked-in
-a-radiobuttongroup-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe. <http://www.adobe.com/2006/mxml>
com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white" viewSourceURL="srcview/index.html">

<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;

private function radioGroup_itemClick(evt:ItemClickEvent):void {

//Code that will populate panel with specific controls 

}
]]>
</mx:Script>

<mx:RadioButtonGroup id="radioGroup"
itemClick="radioGroup_itemClick(event);" />

<mx:VBox>
<mx:RadioButton id="radioButton1"
label="Type1"
group="{radioGroup}" />
<mx:RadioButton id="Type2"
label="Orange"
group="{radioGroup}" />

</mx:VBox>

<mx:Panel id= "TypeControls" x="282" y="24" width="504" height="373"
layout="absolute" title="Trunk Settings">
</mx:Panel>

</mx:Application>



Reply via email to