sap.m.SelectList.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.SelectList 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:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.m.SelectList.
Returns:
Adds some ariaLabelledBy into the association ariaLabelledBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
- Since:
- 1.27.0
Returns:
Adds some item to the aggregation items
.
Parameters:
Returns:
Attaches event handler
fnFunction
to the
itemPress
event of this
sap.m.SelectList
.
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.m.SelectList
itself.
This event is fired when an item is pressed.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.m.SelectList itself |
- Since:
- 1.32.4
Returns:
Attaches event handler
fnFunction
to the
selectionChange
event of this
sap.m.SelectList
.
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.m.SelectList
itself.
This event is fired when the selection has changed.
Note: The selection can be changed by pressing an non-selected item or via keyboard and after the enter or space key is pressed.
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.m.SelectList itself |
Returns:
Parameters:
{object} | oBindingInfo | The binding information |
Returns:
clearSelection()
Clear the selection.
Destroys all the items in the aggregation named items
.
Returns:
Detaches event handler
fnFunction
from the
itemPress
event of this
sap.m.SelectList
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
- Since:
- 1.32.4
Returns:
Detaches event handler
fnFunction
from the
selectionChange
event of this
sap.m.SelectList
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
Fires event
itemPress
to attached listeners.
Expects the following event parameters:
item
of type sap.ui.core.Item
The pressed item.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
- Since:
- 1.32.4
Returns:
Fires event
selectionChange
to attached listeners.
Expects the following event parameters:
selectedItem
of type sap.ui.core.Item
The selected item.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy
.
- Since:
- 1.27.0
Returns:
Retrieves the default selected item from the aggregation named items
.
Parameters:
Returns:
getEnabled(): boolean
Gets current value of property
enabled
.
Indicates whether the user can change the selection.
Default value is true
.
Returns:
{boolean} | Value of property enabled |
Gets the enabled items from the aggregation named items
.
Parameters:
Returns:
Gets the first item from the aggregation named items
.
Returns:
Gets the item from the aggregation named items
at the given 0-based index.
Parameters:
{int} | iIndex | Index of the item to return. |
Returns:
Gets the item with the given key from the aggregation named
items
.
Note: If duplicate keys exists, the first item matching the key is returned.
Parameters:
{string} | sKey | An item key that specifies the item to retrieve. |
Returns:
Gets content of aggregation
items
.
Defines the items contained within this control.
Returns:
Gets current value of property
keyboardNavigationMode
.
Defines the keyboard navigation mode.
Note: The sap.m.SelectListKeyboardNavigationMode.None
enumeration value, is only intended for use in some composite controls that handles keyboard navigation by themselves.
Default value is Delimited
.
- Since:
- 1.38
Returns:
Gets the enabled items from the aggregation named items
.
Returns:
Gets current value of property
maxWidth
.
Sets the maximum width of the control.
Default value is 100%
.
Returns:
Gets the selected item object from the aggregation named items
.
Returns:
{sap.ui.core.Item|null} | The current target of the selectedItem association, or null. |
getSelectedItemId(): string
Gets current value of property
selectedItemId
.
ID of the selected item.
Default value is
.
Returns:
{string} | Value of property selectedItemId |
getSelectedKey(): string
Gets current value of property
selectedKey
.
Key of the selected item.
Note: If duplicate keys exist, the first item matching the key is used.
Default value is
.
Returns:
{string} | Value of property selectedKey |
getShowSecondaryValues(): boolean
Gets current value of property
showSecondaryValues
.
Indicates whether the text values of the additionalText
property of a sap.ui.core.ListItem are shown.
Default value is false
.
- Since:
- 1.32.3
Returns:
{boolean} | Value of property showSecondaryValues |
Gets current value of property
width
.
Sets the width of the control.
Default value is auto
.
Returns:
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:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a item into the aggregation items
.
Parameters:
{sap.ui.core.Item} | oItem | the item to insert; if empty, nothing is inserted |
{int} | iIndex | the 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:
Removes all the controls in the association named ariaLabelledBy
.
- Since:
- 1.27.0
Returns:
Removes all the items in the aggregation named items
. Additionally unregisters them from the hosting UIArea.
Returns:
Removes an ariaLabelledBy from the association named ariaLabelledBy
.
Parameters:
{int|string|sap.ui.core.Control} | vAriaLabelledBy | The ariaLabelledByto be removed or its index or ID |
- Since:
- 1.27.0
Returns:
Removes an item from the aggregation named items
.
Parameters:
Returns:
Sets a new value for property
enabled
.
Indicates whether the user can change the selection.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bEnabled | New value for property enabled |
Returns:
Sets a new value for property
keyboardNavigationMode
.
Defines the keyboard navigation mode.
Note: The sap.m.SelectListKeyboardNavigationMode.None
enumeration value, is only intended for use in some composite controls that handles keyboard navigation by themselves.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Delimited
.
Parameters:
- Since:
- 1.38
Returns:
Sets a new value for property
maxWidth
.
Sets the maximum width of the control.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 100%
.
Parameters:
Returns:
Sets the selectedItem
association.
Parameters:
{string|sap.ui.core.Item|null} | vItem | New value for the selectedItem association. If an ID of a sap.ui.core.Item is given, the item with this ID becomes the selectedItem association. Alternatively, a sap.ui.core.Item instance may be given or null to clear the selection. |
Returns:
Sets property
selectedItemId
.
Default value is an empty string ""
or undefined
.
Parameters:
{string|undefined} | vItem | New value for property selectedItemId . |
Returns:
Sets property
selectedKey
.
Default value is an empty string ""
or undefined
.
Parameters:
{string} | sKey | New value for property selectedKey . |
Returns:
setSelection(vItem)
Updates and synchronizes selectedItem
association, selectedItemId
and selectedKey
properties.
Parameters:
Sets a new value for property
showSecondaryValues
.
Indicates whether the text values of the additionalText
property of a sap.ui.core.ListItem are shown.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Parameters:
{boolean} | bShowSecondaryValues | New value for property showSecondaryValues |
- Since:
- 1.32.3
Returns:
Sets a new value for property
width
.
Sets the width of the control.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is auto
.
Parameters:
Returns:
Unbinds aggregation items
from model data.
Returns: