Use radio button to change state : RadioButton « Components « Flex






Use radio button to change state

Use radio button to change state
       
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
  backgroundColor="#eeeeee" layout="absolute">
  <mx:states>
    <mx:State name="oneway">
      <mx:RemoveChild target="{label1}"/>
      <mx:RemoveChild target="{departDate}"/>
    </mx:State>
  </mx:states>

  <mx:Panel title="Select travel dates" layout="absolute" width="421" height="246" id="panel1" x="34" y="55"
    headerHeight="75" borderAlpha="1" >
    <mx:DateField x="61" y="57" id="returnDate"/>
    <mx:Label x="10" y="59" text="Depart:"/>

    <mx:Label x="183" y="59" text="Return:" id="label1"/>
    <mx:DateField x="239" y="57" id="departDate"/>
    <mx:ControlBar>
      <mx:RadioButtonGroup id="typeGroup"/>
      <mx:RadioButton label="Round Trip" selected="true" click="currentState=''"/>
      <mx:RadioButton label="One Way" click="currentState='oneway'"/>
      <mx:Spacer width="100%"/>
      <mx:Button label="Search"/>
    </mx:ControlBar>
  </mx:Panel>
  
</mx:Application>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Add RadioButton to RadioButtonGroupAdd RadioButton to RadioButtonGroup
2.RadioButton click eventRadioButton click event
3.RadioButton default valueRadioButton default value
4.Define RadioButton control with Define RadioButton control with <mx:RadioButton>
5.Create RadioButton group using the RadioButtonGroup controlCreate RadioButton group using the RadioButtonGroup control
6.Bind bindable variable to RadioButtonBind bindable variable to RadioButton
7.Bind RadioButton to ModelBind RadioButton to Model
8. and three <mx:RadioButtonGroup/> and three <mx:RadioButton/>
9.Change Image value by using RadioButtonChange Image value by using RadioButton
10.Create a RadioButtonGroup and put RadioButton into itCreate a RadioButtonGroup and put RadioButton into it
11.Use style to change font size and weight for RadioButton and LabelUse style to change font size and weight for RadioButton and Label
12.RadioButton with group nameRadioButton with group name