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:

Summary


Constructor
Instance properties
Instance methods
Event handlers

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

private mSelection:IRadioButton
(read)

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.

getIndex

private function getIndex (
inButton:IRadioButton) : Number

Returns:
  • The index of the button in the group.

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 broadcasted to listeners:

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.