qnx.fuse.ui.buttons.RadioButtonGroup

RadioButtonGroup

Properties | Methods | Events


Packageqnx.fuse.ui.buttons
Classpublic class RadioButtonGroup
InheritanceRadioButtonGroup Inheritance flash.events.EventDispatcher

The RadioButtonGroup class contains the functionality for handling a group of related radio buttons.

Class information:
BlackBerry 10 Version:   10.0.0
Found in:  qnxui.swc

See also

RadioButton



Public Properties

 PropertyDefined By
  length : int
[read-only] Returns the number of buttons that have been added to the group.
RadioButtonGroup
  name : String
[read-only] Returns the name of the group.
RadioButtonGroup
  selection : RadioButton
[read-only] Returns the currently selected radio button.
RadioButtonGroup

Public Methods

 MethodDefined By
  
RadioButtonGroup(groupname:String)
Do not use this constructor.
RadioButtonGroup
  
addButton(button:RadioButton):void
Adds a button of type RadioButton to the group.
RadioButtonGroup
  
[static] Returns a radio button group object given a unique name.
RadioButtonGroup
  
[static] Returns a unique ID to ensure radio group IDs are not duplicated.
RadioButtonGroup
  
Removes the specified button from the group (assuming the button exists).
RadioButtonGroup
  
setSelectedRadioButton(button:RadioButton, throwEvent:Boolean = true):void
Selects the specified RadioButton.
RadioButtonGroup

Events

 Event Summary Defined By
  Dispatched when the selection property of the group changes.RadioButtonGroup

Property Detail

length


length:int  [read-only]

Returns the number of buttons that have been added to the group.


Implementation

public function get length():int

name


name:String  [read-only]

Returns the name of the group.


Implementation

public function get name():String

selection


selection:RadioButton  [read-only]

Returns the currently selected radio button.


Implementation

public function get selection():RadioButton

See also

RadioButton

Constructor Detail

RadioButtonGroup()


public function RadioButtonGroup(groupname:String)

Do not use this constructor.

Instead, use the getGroup() method to create a RadioButtonGroup instance.

Parameters

groupname:String

See also

getGroup()

Method Detail

addButton()


public function addButton(button:RadioButton):void

Adds a button of type RadioButton to the group.

Note that in order to add a button to a group, you must also set the groupname property of each button to the name of the RadioGroupName.

Parameters

button:RadioButton — The button to add to the group. Must be of type RadioButton.

See also

RadioButton

getGroup()


public static function getGroup(name:String):RadioButtonGroup

Returns a radio button group object given a unique name. Use this method in order to create a new RadioButtonGroup instance.

In the following listing, a RadioButtonGroup is instantiated and given the unique name rbg1_meals13.

var rbg1:RadioButtonGroup = RadioButtonGroup.getGroup( "rbg1_meals13" );
rbg1.addButton( rb1 );
rbg1.addButton( rb2 );
rbg1.addButton( rb3 );
rbg1.addEventListener( MouseEvent.CLICK, rbg1Change );
rbg1.setSelectedRadioButton( rb2 );
         

Parameters

name:String — The name of the group.

Returns

RadioButtonGroup — RadioButtonGroup

getUniqueId()


public static function getUniqueId():int

Returns a unique ID to ensure radio group IDs are not duplicated.

Returns

int — A unique int.

removeButton()


public function removeButton(button:RadioButton):void

Removes the specified button from the group (assuming the button exists).

Parameters

button:RadioButton — The RadioButton to remove from the group.

See also

RadioButton

setSelectedRadioButton()


public function setSelectedRadioButton(button:RadioButton, throwEvent:Boolean = true):void

Selects the specified RadioButton.

Parameters

button:RadioButton — The button to set to selected. Must be of type RadioButton.
throwEvent:Boolean (default = true) — If true, the RadioButtonGroup will throw an Event.CHANGE event to signal the selection has changed.

See also

RadioButton

Event Detail

change


Event Object Type: flash.events.Event
Event.type property = flash.events.Event.CHANGE

Dispatched when the selection property of the group changes.





comments powered by Disqus