Paquete | spark.components |
Clase | public class RadioButtonGroup |
Herencia | RadioButtonGroup EventDispatcher Object |
Implementa | IMXMLObject |
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
id
property is required when you use the
<s:RadioButtonGroup>
tag to define the group name. Any
<s:RadioButton>
component added to this group will
have this group name.
Notice that the RadioButtonGroup component is a subclass of EventDispatcher,
not UIComponent, and implements the IMXMLObject interface.
All other Flex visual components implement the IVisualElement interface.
The RadioButtonGroup component declaration must
be contained within the <Declarations>
tag since it is
not assignable to IVisualElement.
To use this component in a list-based component, such as a List or DataGrid, create an item renderer. For information about creating an item renderer, see Custom Spark item renderers.
Sintaxis MXMLOcultar sintaxis MXMLThe <s:RadioButtonGroup>
tag inherits all of the
tag attributes of its superclass, and adds the following tag attributes:
<s:RadioButtonGroup Properties enabled="true" selectedValue="null" selection="null" Events change="No default" itemClick="No default" valueCommit="No default" />
Más ejemplos
Elementos de API relacionados
Propiedad | Definido por | ||
---|---|---|---|
constructor : Object
Una referencia a la clase de objeto o función constructora para una instancia de objeto determinada. | Object | ||
enabled : Boolean
Determines whether selection is allowed. | RadioButtonGroup | ||
numRadioButtons : int [solo lectura]
The number of RadioButtons that belong to this RadioButtonGroup. | RadioButtonGroup | ||
selectedValue : Object
The value property of the selected
RadioButton component in the group, if it has been set,
otherwise, the label property of the selected RadioButton. | RadioButtonGroup | ||
selection : RadioButton
Contains a reference to the currently selected
RadioButton component in the group. | RadioButtonGroup |
Método | Definido por | ||
---|---|---|---|
RadioButtonGroup(document:IFlexDisplayObject = null)
Constructor. | RadioButtonGroup | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registra un objeto de detector de eventos con un objeto EventDispatcher, de modo que el detector reciba la notificación de un evento. | EventDispatcher | ||
Distribuye un evento en el flujo del evento. | EventDispatcher | ||
Returns the RadioButton component at the specified index. | RadioButtonGroup | ||
Comprueba si el objeto EventDispatcher tiene detectores registrados para un tipo concreto de evento. | EventDispatcher | ||
Indica si un objeto tiene definida una propiedad especificada. | Object | ||
Implementation of the IMXMLObject.initialized() method
to support deferred instantiation. | RadioButtonGroup | ||
Indica si hay una instancia de la clase Object en la cadena de prototipo del objeto especificado como parámetro. | Object | ||
Indica si existe la propiedad especificada y si es enumerable. | Object | ||
Elimina un detector del objeto EventDispatcher. | EventDispatcher | ||
Establece la disponibilidad de una propiedad dinámica para operaciones de bucle. | Object | ||
Devuelve la representación de cadena de este objeto, con formato según las convenciones específicas de configuración regional. | Object | ||
Devuelve la representación de cadena del objeto especificado. | Object | ||
Devuelve el valor simple del objeto especificado. | Object | ||
Comprueba si hay registrado un detector de eventos con este objeto EventDispatcher o con cualquiera de sus ascendientes para el tipo de evento concreto. | EventDispatcher |
Evento | Resumen | Definido por | ||
---|---|---|---|---|
[evento broadcast] Se distribuye cuando Flash Player o AIR pasan a estar activos. | EventDispatcher | |||
Dispatched when the value of the selected RadioButton component in this group changes. | RadioButtonGroup | |||
[evento broadcast] Se distribuye cuando Flash Player o de AIR pasan a estar inactivos. | EventDispatcher | |||
Dispatched when a user selects a RadioButton component in the group. | RadioButtonGroup | |||
Dispatched when values are changed programmatically or by user interaction. | RadioButtonGroup |
enabled | propiedad |
enabled:Boolean
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Determines whether selection is allowed. Note that the value returned
only reflects the value that was explicitly set on the
RadioButtonGroup
and does not reflect any values explicitly
set on the individual RadioButtons.
El valor predeterminado es true.
Implementación
public function get enabled():Boolean
public function set enabled(value:Boolean):void
numRadioButtons | propiedad |
numRadioButtons:int
[solo lectura] Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
The number of RadioButtons that belong to this RadioButtonGroup.
El valor predeterminado es "0".
Esta propiedad se puede utilizar como origen para la vinculación de datos. Cuando se modifica esta propiedad, distribuye el evento numRadioButtonsChanged
.
Implementación
public function get numRadioButtons():int
selectedValue | propiedad |
selectedValue:Object
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
The value
property of the selected
RadioButton component in the group, if it has been set,
otherwise, the label
property of the selected RadioButton.
If no RadioButton is selected, this property is null
.
If you set selectedValue
, Flex selects the
first RadioButton component whose value
or
label
property matches this value.
El valor predeterminado es null.
Esta propiedad se puede utilizar como origen para la vinculación de datos. Cuando se modifica esta propiedad, distribuye el evento valueCommit
.
Implementación
public function get selectedValue():Object
public function set selectedValue(value:Object):void
selection | propiedad |
selection:RadioButton
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Contains a reference to the currently selected
RadioButton component in the group.
You can access this property in ActionScript only;
it is not settable in MXML.
Setting this property to null
deselects the currently
selected RadioButton component. A change event is not dispatched.
El valor predeterminado es null.
Esta propiedad se puede utilizar como origen para la vinculación de datos. Cuando se modifica esta propiedad, distribuye el evento valueCommit
.
Implementación
public function get selection():RadioButton
public function set selection(value:RadioButton):void
RadioButtonGroup | () | Información sobre |
public function RadioButtonGroup(document:IFlexDisplayObject = null)
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Constructor.
Parámetrosdocument:IFlexDisplayObject (default = null ) — In simple cases where a class extends EventDispatcher,
the document parameter should not be used.
|
Elementos de API relacionados
getRadioButtonAt | () | método |
public function getRadioButtonAt(index:int):RadioButton
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Returns the RadioButton component at the specified index.
Parámetros
index:int — The 0-based index of the RadioButton in the
RadioButtonGroup.
|
RadioButton — The specified RadioButton component if index is between
0 and numRadioButtons - 1. Returns
null if the index is invalid.
|
Elementos de API relacionados
initialized | () | método |
public function initialized(document:Object, id:String):void
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Implementation of the IMXMLObject.initialized()
method
to support deferred instantiation.
Parámetros
document:Object — The MXML document that created this object.
| |
id:String — The identifier used by document to refer to this object.
If the object is a deep property on document, id is null.
|
Elementos de API relacionados
change | Evento |
flash.events.Event
propiedad Event.type =
flash.events.Event.CHANGE
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Dispatched when the value of the selected RadioButton component in this group changes.
La constanteEvent.CHANGE
define el valor de la propiedad type
de un objeto de evento change
.
Este evento tiene las propiedades siguientes:
Propiedad | Valor |
---|---|
bubbles | true |
cancelable | false ; no hay ningún comportamiento predeterminado que cancelar. |
currentTarget | Objeto que procesa de forma activa el objeto de evento con un detector de eventos. |
target | Objeto al que se ha modificado su valor. El objeto target no siempre es el objeto de la lista de visualización que registró el detector de eventos. Utilice la propiedad currentTarget para acceder al objeto de la lista de visualización que está procesando el evento actualmente. |
itemClick | Evento |
mx.events.ItemClickEvent
propiedad ItemClickEvent.type =
mx.events.ItemClickEvent.ITEM_CLICK
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Dispatched when a user selects a RadioButton component in the group. You can also set a handler for individual RadioButton components. This event is dispatched only when the user interacts with the radio buttons by using the mouse.
TheItemClickEvent.ITEM_CLICK
constant defines the value of the
type
property of the event object for an itemClick
event.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
index | The index of the navigation item that was clicked. |
item | The item in the data provider of the navigation item that was clicked. |
label | The label of the navigation item that was clicked. |
relatedObject | The child object that generated the event. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
valueCommit | Evento |
mx.events.FlexEvent
propiedad FlexEvent.type =
mx.events.FlexEvent.VALUE_COMMIT
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 4 |
Versiones de motor de ejecución: | Flash Player 10, AIR 1.5 |
Dispatched when values are changed programmatically or by user interaction.
Because a programmatic change triggers this event, make sure
that any valueCommit
event handler does not change
a value that causes another valueCommit
event.
For example, do not change theselectedValue
property or selection
property in a valueCommit
event handler.
FlexEvent.VALUE_COMMIT
constant defines the value of the
type
property of the event object for a valueCommit
event.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <fx:Script> <![CDATA[ import mx.controls.Alert; import mx.events.ItemClickEvent; private function handlePayment(event:ItemClickEvent):void { if (event.currentTarget.selectedValue == "check") { Alert.show("You opted to pay by check."); } else if (event.currentTarget.selectedValue == "credit") { Alert.show("You opted to pay by credit card."); } } ]]> </fx:Script> <fx:Declarations> <s:RadioButtonGroup id="paymentType" itemClick="handlePayment(event);"/> </fx:Declarations> <s:VGroup paddingLeft="10" paddingTop="10"> <s:RadioButton groupName="paymentType" id="payCheck" value="check" label="Pay by check" width="150"/> <s:RadioButton groupName="paymentType" id="payCredit" value="credit" label="Pay by credit card" width="150"/> </s:VGroup> </s:Application>
Tue Jun 12 2018, 02:12 PM Z