XUL:radiogroup
From MDC
« XUL Reference home [ Examples | Attributes | Properties | Methods | Related ]
A group of radio buttons. Only one radio button inside the group can be selected at a time. The radio buttons may either direct children of the radiogroup or descendants. Place the radiogroup inside a groupbox if you would like a border or caption for the group. The radiogroup defaults to vertical orientation.
More information is available in the XUL tutorial.
- Attributes
- disabled, focused, preference, tabindex, value
- Properties
- accessibleType, disabled, focusedItem, itemCount, selectedIndex, selectedItem, tabIndex, value
- Methods
- appendItem, checkAdjacentElement, getIndexOfItem, getItemAtIndex, insertItemAt, removeItemAt
[edit] Examples
<radiogroup> <radio id="orange" label="Red"/> <radio id="violet" label="Green" selected="true"/> <radio id="yellow" label="Blue"/> </radiogroup>
[edit] Attributes
|
Inherited from XUL element |
- disabled
- Type: boolean
- Indicates whether the element is disabled or not. If this element is set to
truethe element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and thecommandevent will not fire.
- focused
- Type: boolean
- This attribute is
trueif the element is focused.
- preference
- Type: element id
- Connects the element to a corresponding preference. This attribute only has any effect when used inside a prefwindow. The value of the preference will be updated to match the value property of the element.
- tabindex
- Type: integer
- The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher
tabindexare later in the tab sequence.
- value
- Type: string
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.
[edit] Properties
|
Inherited from XUL element Inherited from DOM element |
- accessibleType
- Type: integer
- A value indicating the type of accessibility object for the element.
- focusedItem
- Type: radio element
- Holds the currently focused item in the radiogroup, which may or may not be the same as the selected item. You can change the focused item by setting this property.
- selectedIndex
- Type: integer
- Returns the index of the currently selected item. You may select an item by assigning its index to this property. By assigning
-1to this property, all items will be deselected.
- selectedItem
- Type: element
- Holds the currently selected item. If no item is currently selected, this value will be
null. You can select an item by setting this value. A select event will be sent to the element when it is changed either via this property, the selectedIndex property, or changed by the user.
[edit] Methods
|
Inherited from XUL element Inherited from DOM element |
- appendItem( label, value )
- Return type: element
- Creates a new item and adds it to the end of the existing list of items. You may optionally set a value. The function returns the newly created element.
- checkAdjacentElement( dir )
- Return type: no return value
- Deselects the currently selected radio button in the group and selects the one adjacent to it. If the argument dir is
true, the next radio button is selected. If it isfalse, the previous radio button is selected.
- getIndexOfItem( item )
- Return type: integer
- Returns the zero-based position of the specified item. Items are numbered starting at the first item displayed in the list.
- getItemAtIndex( index )
- Return type: element
- Returns the element that is at the specified index.
- insertItemAt( index, label, value )
- Return type: element
- This method creates a new item and inserts it at the specified position. You may optionally set a value. The new item element is returned.
- removeItemAt( index )
- Return type: element
- Removes the child item in the element at the specified index. The method returns the removed item.
[edit] Related
- Interfaces
- nsIAccessibleProvider, nsIDOMXULSelectControlElement
