Class sap.ui.commons.RadioButtonGroupModule: sap/ui/commons/RadioButtonGroup

extends Control
implements IFormContent

The RadioButtonGroup is a basic control that is used to provide area for making interactive choice out of a set of options. It represents a list with items where exactly one item can be selected in a session. For the representation of the single group entries, the RadioButton items are created automatically. For the RadioButton choice, mouse and keyboard navigation usage is supported.
Deprecated API:
Since version 1.38. Instead, use the sap.m.RadioButtonGroup control.
Constructor Summary
new sap.ui.commons.RadioButtonGroup(sId?, mSettings?)Constructor for a new RadioButtonGroup.
Event Summary
select(oControlEvent)Fires when selection is changed by user interaction.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.RadioButtonGroup.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.RadioButtonGroup with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.RadioButtonGroup.getMetadata()Returns a metadata object for class sap.ui.commons.RadioButtonGroup.
addAriaDescribedBy(vAriaDescribedBy)Adds some ariaDescribedBy into the association ariaDescribedBy.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
addItem(oItem)Adds some item to the aggregation items.
attachSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the select event of this sap.ui.commons.RadioButtonGroup.
bindItems(oBindingInfo)Binds aggregation items to model data.
clone()Creates a new instance of RadioButtonGroup, with the same settings as the RadioButtonGroup on which the method is called.
destroyItems()Destroys all the items in the aggregation items.
detachSelect(fnFunction, oListener)Detaches event handler fnFunction from the select event of this sap.ui.commons.RadioButtonGroup.
fireSelect(mParameters?)Fires event select to attached listeners.
getAriaDescribedBy()Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
getColumns()Gets current value of property columns.
getEditable()Gets current value of property editable.
getEnabled()Gets current value of property enabled.
getItems()Gets content of aggregation items.
getSelectedIndex()Gets current value of property selectedIndex.
getSelectedItem()When no item is selected, "null" is returned.
getValueState()Gets current value of property valueState.
getWidth()Gets current value of property width.
indexOfItem(oItem)Checks for the provided sap.ui.core.Item in the aggregation items.
insertItem(oItem, iIndex)Inserts a item into the aggregation items.
removeAllAriaDescribedBy()Removes all the controls in the association named ariaDescribedBy.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAllItems()Removes all the controls from the aggregation items.
removeAriaDescribedBy(vAriaDescribedBy)Removes an ariaDescribedBy from the association named ariaDescribedBy.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
removeItem(vItem)Removes a item from the aggregation items.
setColumns(iColumns)Sets a new value for property columns.
setEditable(bEditable)Sets a new value for property editable.
setEnabled(bEnabled)Sets a new value for property enabled.
setSelectedIndex(iSelectedIndex)Sets a new value for property selectedIndex.
setSelectedItem(oSelectedItem)Sets the Item as selected and removes the selection from the previous one.
setValueState(sValueState)Sets a new value for property valueState.
setWidth(sWidth)Sets a new value for property width.
unbindItems()Unbinds aggregation items from model data.
Constructor Detail
new sap.ui.commons.RadioButtonGroup(sId?, mSettings?)

Constructor for a new RadioButtonGroup.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties

  • Aggregations

    • items : sap.ui.core.Item[] (default)

  • Associations

  • Events

    • select : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
stringsId?ID for the new control, generated automatically if no ID is given
objectmSettings?Initial settings for the new control
Event Detail
select(oControlEvent)
Fires when selection is changed by user interaction.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
intoControlEvent.getParameters.selectedIndexIndex of the selected RadioButton.
Method Detail
sap.ui.commons.RadioButtonGroup.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.ui.commons.RadioButtonGroup with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.commons.RadioButtonGroup.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.RadioButtonGroup.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addAriaDescribedBy(vAriaDescribedBy): sap.ui.commons.RadioButtonGroup
Adds some ariaDescribedBy into the association ariaDescribedBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaDescribedBythe ariaDescribedBy to add; if empty, nothing is inserted
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
addAriaLabelledBy(vAriaLabelledBy): sap.ui.commons.RadioButtonGroup
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledBythe ariaLabelledBy to add; if empty, nothing is inserted
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
Adds some item to the aggregation items.
Parameters:
sap.ui.core.ItemoItemthe item to add; if empty, nothing is inserted
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
attachSelect(oData?, fnFunction, oListener?): sap.ui.commons.RadioButtonGroup

Attaches event handler fnFunction to the select event of this sap.ui.commons.RadioButtonGroup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.commons.RadioButtonGroup itself.

Fires when selection is changed by user interaction.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.commons.RadioButtonGroup itself
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
bindItems(oBindingInfo): sap.ui.commons.RadioButtonGroup

Binds aggregation items to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Parameters:
objectoBindingInfoThe binding information
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
Creates a new instance of RadioButtonGroup, with the same settings as the RadioButtonGroup on which the method is called. Event handlers are not cloned.
Returns:
sap.ui.commons.RadioButtonGroupNew instance of RadioButtonGroup
Destroys all the items in the aggregation items.
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
detachSelect(fnFunction, oListener): sap.ui.commons.RadioButtonGroup

Detaches event handler fnFunction from the select event of this sap.ui.commons.RadioButtonGroup.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
fireSelect(mParameters?): sap.ui.commons.RadioButtonGroup
Fires event select to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
intmParameters.selectedIndex?Index of the selected RadioButton.
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
getAriaDescribedBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns:
sap.ui.core.ID[]
getAriaLabelledBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
sap.ui.core.ID[]
getColumns(): int

Gets current value of property columns.

Determines the maximum number of RadioButtons displayed in one line.

Default value is 1.

Returns:
intValue of property columns
getEditable(): boolean

Gets current value of property editable.

Specifies whether the user can change the selected value of the RadioButtonGroup. When the property is set to false, the control obtains visual styles different from its visual styles for the normal and the disabled state. Additionally the control is no longer interactive, but can receive focus.

Default value is true.

Returns:
booleanValue of property editable
getEnabled(): boolean

Gets current value of property enabled.

Enables/disables the RadioButtonGroup. If it is disabled all RadioButtons will be displayed as disabled. The enabled property of the Item will not be used in this case. If the RadioButtonGroup is enabled, the enabled property of the Item will define if a RadioButton is enabled or not.

Default value is true.

Returns:
booleanValue of property enabled
Since:
1.10.3
getItems(): sap.ui.core.Item[]

Gets content of aggregation items.

The RadioButtons of this RadioButtonGroup.

Returns:
sap.ui.core.Item[]
getSelectedIndex(): int

Gets current value of property selectedIndex.

The index of the selected/checked RadioButton.

Default value is 0.

Returns:
intValue of property selectedIndex
getSelectedItem(): sap.ui.core.Item
When no item is selected, "null" is returned.
Returns:
sap.ui.core.ItemSelected Item
getValueState(): sap.ui.core.ValueState

Gets current value of property valueState.

Тhe value state to be displayed for the RadioButton. Possible values are: sap.ui.core.ValueState.Error, sap.ui.core.ValueState.Warning, sap.ui.core.ValueState.Success and sap.ui.core.ValueState.None. Note: Setting this attribute to sap.ui.core.ValueState.Error when the accessibility feature is enabled, sets the value of the invalid property for the whole RadioButtonGroup to true.

Default value is None.

Returns:
sap.ui.core.ValueStateValue of property valueState
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

Defines the width of the RadioButtonGroup.

Returns:
sap.ui.core.CSSSizeValue of property width
indexOfItem(oItem): int
Checks for the provided sap.ui.core.Item in the aggregation items. and returns its index if found or -1 otherwise.
Parameters:
sap.ui.core.ItemoItemThe item whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
insertItem(oItem, iIndex): sap.ui.commons.RadioButtonGroup
Inserts a item into the aggregation items.
Parameters:
sap.ui.core.ItemoItemthe item to insert; if empty, nothing is inserted
intiIndexthe 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
removeAllAriaDescribedBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaDescribedBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAllAriaLabelledBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAllItems(): sap.ui.core.Item[]

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.ui.core.Item[]An array of the removed elements (might be empty)
removeAriaDescribedBy(vAriaDescribedBy): sap.ui.core.ID
Removes an ariaDescribedBy from the association named ariaDescribedBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaDescribedByThe ariaDescribedBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaDescribedBy or null
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.ID
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledByThe ariaLabelledBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaLabelledBy or null
removeItem(vItem): sap.ui.core.Item
Removes a item from the aggregation items.
Parameters:
int|string|sap.ui.core.ItemvItemThe item to remove or its index or id
Returns:
sap.ui.core.ItemThe removed item or null
setColumns(iColumns): sap.ui.commons.RadioButtonGroup

Sets a new value for property columns.

Determines the maximum number of RadioButtons displayed in one line.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 1.

Parameters:
intiColumnsNew value for property columns
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
setEditable(bEditable): sap.ui.commons.RadioButtonGroup

Sets a new value for property editable.

Specifies whether the user can change the selected value of the RadioButtonGroup. When the property is set to false, the control obtains visual styles different from its visual styles for the normal and the disabled state. Additionally the control is no longer interactive, but can receive focus.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
booleanbEditableNew value for property editable
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
setEnabled(bEnabled): sap.ui.commons.RadioButtonGroup

Sets a new value for property enabled.

Enables/disables the RadioButtonGroup. If it is disabled all RadioButtons will be displayed as disabled. The enabled property of the Item will not be used in this case. If the RadioButtonGroup is enabled, the enabled property of the Item will define if a RadioButton is enabled or not.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
booleanbEnabledNew value for property enabled
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
Since:
1.10.3
setSelectedIndex(iSelectedIndex): sap.ui.commons.RadioButtonGroup

Sets a new value for property selectedIndex.

The index of the selected/checked RadioButton.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0.

Parameters:
intiSelectedIndexNew value for property selectedIndex
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
setSelectedItem(oSelectedItem)
Sets the Item as selected and removes the selection from the previous one.
Parameters:
sap.ui.core.ItemoSelectedItemSelected item
setValueState(sValueState): sap.ui.commons.RadioButtonGroup

Sets a new value for property valueState.

Тhe value state to be displayed for the RadioButton. Possible values are: sap.ui.core.ValueState.Error, sap.ui.core.ValueState.Warning, sap.ui.core.ValueState.Success and sap.ui.core.ValueState.None. Note: Setting this attribute to sap.ui.core.ValueState.Error when the accessibility feature is enabled, sets the value of the invalid property for the whole RadioButtonGroup to true.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is None.

Parameters:
sap.ui.core.ValueStatesValueStateNew value for property valueState
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining

Sets a new value for property width.

Defines the width of the RadioButtonGroup.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
sap.ui.core.CSSSizesWidthNew value for property width
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining
Unbinds aggregation items from model data.
Returns:
sap.ui.commons.RadioButtonGroupReference to this in order to allow method chaining