RadioButtonGroup
| Kind of class: | class |
|---|---|
| Inherits from: | Dispatcher |
| Implements: | |
| Author: | Martijn de Visser |
| Classpath: | org.asapframework.ui.buttons.radio.RadioButtonGroup |
| File last modified: | Saturday, 07 October 2006, 00:27:45 |
RadioButtonGroup manages a group of RadioButtons.
Usage:
- The following code creates a new RadioButtonGroup and adds three buttons, the first of which is set to selected state.
var myGroup:RadioButtonGroup = new RadioButtonGroup(); myGroup.addButton(myButton1,true); myGroup.addButton(myButton2); myGroup.addButton(myButton3);
Events broadcasted to listeners:
- RadioGroupEvent with type:
ON_CHANGED- (null)
Summary
Constructor
- RadioButtonGroup (inListener:Object)
- Creates a new RadioButtonGroup
Instance properties
- mGroup : Array
- mSelection : IRadioButton
Instance properties inherited from Dispatcher
Instance methods
- addButton (inButton:RadioButton, inSelected:Boolean) : Void
- Adds a button to the RadioButtonGroup
- removeButton (inButton:RadioButton) : Void
- Removes a button fron the RadioButtonGroup
- select (inButton:IRadioButton, inInternal:Boolean) : Void
- Used to (de)select a RadioButton
- setSelectedIndex (inIndex:Number) : Void
- Selects a button by index.
- deselectAll : Void
- Deselects all radio buttons.
- clear : Void
- Removes all RadioButtons from the group.
- getElements : Array
- toString : String
- getValue : Object
- getIndex (inButton:IRadioButton) : Number
Event handlers
- onRadioButtonSelected (e:RadioButtonEvent) : Void
- Triggered by RadioButtons added to this group.
Constructor
RadioButtonGroup
function RadioButtonGroup (
inListener:Object)
Creates a new RadioButtonGroup
Parameters:
inListener:
subscribes inListener to events from RadioButtonGroup
Instance properties
mGroup
private mGroup:Array
(read)
mSelection
Instance methods
addButton
Adds a button to the RadioButtonGroup
Parameters:
inButton :
, button to add
inSelected:
(optional) set to true to add and also set the button to selected state
clear
function clear (
) : Void
Removes all RadioButtons from the group.
deselectAll
function deselectAll (
) : Void
Deselects all radio buttons.
getElements
function getElements (
) : Array
Returns:
- List of all elements managed by this RadioButtonGroup.
getIndex
Returns:
- The index of the button in the group.
getValue
function getValue (
) : Object
Returns:
- The currently selected button.
Specified by:
removeButton
Removes a button fron the RadioButtonGroup
Parameters:
inButton:
button to remove
select
Used to (de)select a RadioButton
Parameters:
Reference:
to the button to select
Events broadcasted to listeners:
- RadioGroupEvent with type:
ON_CHANGED- (null)
setSelectedIndex
function setSelectedIndex (
inIndex:Number) : Void
Selects a button by index.
toString
function toString (
) : String
Event handlers
onRadioButtonSelected
Triggered by RadioButtons added to this group.