Access keys

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:07:20
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 broadcast to listeners:
RadioGroupEvent with type: ON_CHANGED

Constructor

RadioButtonGroup

function RadioButtonGroup (
inListener:Object)
Creates a new RadioButtonGroup
Parameters:
inListener:
subscribes inListener to events from RadioButtonGroup

Instance methods

addButton

function addButton (
inButton:RadioButton, inSelected:Boolean) : Void
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.

getValue

function getValue (
) : Object
Returns:
The currently selected button.

removeButton

function removeButton (
inButton:RadioButton) : Void
Removes a button fron the RadioButtonGroup
Parameters:
inButton:
button to remove

select

function select (
inButton:IRadioButton, inInternal:Boolean) : Void
Used to (de)select a RadioButton
Parameters:
Reference:
to the button to select
Events broadcast to listeners:
RadioGroupEvent with type: ON_CHANGED

setSelectedIndex

function setSelectedIndex (
inIndex:Number) : Void
Selects a button by index.

toString

function toString (
) : String

Event handlers

onRadioButtonSelected

function onRadioButtonSelected (
Triggered by RadioButtons added to this group.