The sap.m.Select
control provides a list of items that allows users to select an item.
Constructor for a new sap.m.Select
.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.m.Select(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new control, generated automatically if no ID is given. |
|
mSettings? | object | Initial settings for the new control. |
Name | Type | Default Value | Description |
---|---|---|---|
autoAdjustWidth | boolean | false | Indicates whether the width of the input field is determined by the selected item's content. |
columnRatio | sap.m.SelectColumnRatio | 3:2 | Determines the ratio between the first and the second column when secondary values are displayed. Note: This property takes effect only when the |
editable | boolean | true | Determines whether the user can modify the selected item. When the property is set to Note: When both |
enabled | boolean | true | Determines whether the user can modify the selected item. When the property is set to Note: When both |
forceSelection | boolean | true | Indicates whether the selection is restricted to one of the items in the list. Note: We strongly recommend that you always set this property to |
icon | sap.ui.core.URI | empty string | The URI to the icon that will be displayed only when using the |
maxWidth | sap.ui.core.CSSSize | 100% | Sets the maximum width of the control. Note: This property is ignored if the |
name | string | empty string | The name to be used in the HTML code (for example, for HTML forms that send data to the server via submit). Visibility: public |
required | boolean | false | Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation |
resetOnMissingKey | boolean | false | Modifies the behavior of the |
selectedItemId | string | empty string | ID of the selected item. |
selectedKey | string | empty string | Key of the selected item. Notes:
Since: 1.11.Visibility: public |
showSecondaryValues | boolean | false | Indicates whether the text values of the |
textAlign | sap.ui.core.TextAlign | Initial | Sets the horizontal alignment of the text within the input field. |
textDirection | sap.ui.core.TextDirection | Inherit | Specifies the direction of the text within the input field with enumerated options. By default, the control inherits text direction from the DOM. |
type | sap.m.SelectType | Default | Type of a select. Possible values |
valueState | sap.ui.core.ValueState | None | Visualizes the validation state of the control, e.g. |
valueStateText | string | empty string | Defines the text of the value state message popup. If this is not specified, a default text is shown from the resource bundle. |
width | sap.ui.core.CSSSize | auto | Sets the width of the field. By default, the field width is automatically adjusted to the size of its content and the default width of the field is calculated based on the widest list item in the dropdown list. If the width defined is smaller than its content, only the field width is changed whereas the dropdown list keeps the width of its content. If the dropdown list is wider than the visual viewport, it is truncated and an ellipsis is displayed for each item. For phones, the width of the dropdown list is always the same as the viewport. Note: This property is ignored if the |
wrapItemsText | boolean | false | Determines whether the text in the items wraps on multiple lines when the available width is not enough. When the text is truncated ( |
Default Aggregation: items
Name | Cardinality | Type | Description |
---|---|---|---|
_pickerHeader | 0..1 | sap.m.Bar |
Internal aggregation to hold the picker's header |
_pickerValueStateContent | 0..1 | sap.m.Text |
Internal aggregation to hold the picker's subheader. |
_valueIcon | 0..1 | sap.ui.core.Icon |
Icon, displayed in the left most area of the |
items (default) | 0..n | sap.ui.core.Item |
Defines the items contained within this control. Note: For items with icons you can use sap.ui.core.ListItem. Example:
|
picker | 0..1 | sap.ui.core.PopupInterface |
Internal aggregation to hold the inner picker popup. |
Name | Cardinality | Type | Description |
---|---|---|---|
ariaLabelledBy | 0..n | sap.ui.core.Control |
Association to controls / IDs which label this control (see WAI-ARIA attribute |
selectedItem | 0..1 | sap.ui.core.Item |
Sets or retrieves the selected item from the aggregation named items. |
Event | Description |
---|---|
change |
This event is fired when the value in the selection field is changed in combination with one of the following actions:
|
This event is fired when the value in the selection field is changed in combination with one of the following actions:
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
selectedItem | sap.ui.core.Item |
The selected item. |
previousSelectedItem | sap.ui.core.Item |
The previous selected item. |
Method | Description |
---|---|
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
addItem |
Adds an item to the aggregation named |
attachChange |
Attaches event handler When called, the context of the event handler (its This event is fired when the value in the selection field is changed in combination with one of the following actions:
|
bindItems |
Binds aggregation items to model data. See ManagedObject.bindAggregation for a detailed description of the possible properties of |
close |
Closes the control's picker popup. |
createPicker |
Creates a picker popup container where the selection should take place. |
destroyItems |
Destroys all the items in the aggregation named |
detachChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.m.Select.extend |
Creates a new subclass of class sap.m.Select with name
|
fireChange |
Fires event change to attached listeners. |
getAccessibilityInfo |
Returns the
|
getAriaLabelledBy |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy. |
getAutoAdjustWidth |
Gets current value of property autoAdjustWidth. Indicates whether the width of the input field is determined by the selected item's content. Default value is |
getColumnRatio |
Gets current value of property columnRatio. Determines the ratio between the first and the second column when secondary values are displayed. Note: This property takes effect only when the Default value is |
getEditable |
Gets current value of property editable. Determines whether the user can modify the selected item. When the property is set to Note: When both Default value is |
getEnabled |
Gets current value of property enabled. Determines whether the user can modify the selected item. When the property is set to Note: When both Default value is |
getEnabledItems |
Gets the enabled items from the aggregation named |
getFirstItem |
Gets the first item from the aggregation named |
getFocusDomRef |
Returns the DOM Element that should get the focus. |
getForceSelection |
Gets current value of property forceSelection. Indicates whether the selection is restricted to one of the items in the list. Note: We strongly recommend that you always set this property to Default value is |
getIcon |
Gets current value of property icon. The URI to the icon that will be displayed only when using the Default value is |
getIdForLabel |
Returns the DOMNode Id to be used for the "labelFor" attribute of the label. By default, this is the Id of the control itself. |
getItemAt |
Gets the item from the aggregation named |
getItemByKey |
Gets the item with the given key from the aggregation named Note: If duplicate keys exist, the first item matching the key is returned. |
getItems |
Gets aggregation Note: This is the default aggregation. |
getLastItem |
Gets the last item from the aggregation named |
getMaxWidth |
Gets current value of property maxWidth. Sets the maximum width of the control. Note: This property is ignored if the Default value is |
sap.m.Select.getMetadata |
Returns a metadata object for class sap.m.Select. |
getName |
Gets current value of property name. The name to be used in the HTML code (for example, for HTML forms that send data to the server via submit). Default value is |
getOverflowToolbarConfig |
Enables the |
getRequired |
Gets current value of property required. Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation Default value is |
getResetOnMissingKey |
Gets current value of property resetOnMissingKey. Modifies the behavior of the Default value is |
getSelectedItem |
Gets the selected item object from the aggregation named |
getSelectedItemId |
Gets current value of property selectedItemId. ID of the selected item. Default value is |
getSelectedKey |
Gets current value of property selectedKey. Key of the selected item. Notes:
Default value is |
getShowSecondaryValues |
Gets current value of property showSecondaryValues. Indicates whether the text values of the Default value is |
getTextAlign |
Gets current value of property textAlign. Sets the horizontal alignment of the text within the input field. Default value is |
getTextDirection |
Gets current value of property textDirection. Specifies the direction of the text within the input field with enumerated options. By default, the control inherits text direction from the DOM. Default value is |
getType |
Gets current value of property type. Type of a select. Possible values Default value is |
getValueState |
Gets current value of property valueState. Visualizes the validation state of the control, e.g. Default value is |
getValueStateText |
Gets current value of property valueStateText. Defines the text of the value state message popup. If this is not specified, a default text is shown from the resource bundle. Default value is |
getWidth |
Gets current value of property width. Sets the width of the field. By default, the field width is automatically adjusted to the size of its content and the default width of the field is calculated based on the widest list item in the dropdown list. If the width defined is smaller than its content, only the field width is changed whereas the dropdown list keeps the width of its content. If the dropdown list is wider than the visual viewport, it is truncated and an ellipsis is displayed for each item. For phones, the width of the dropdown list is always the same as the viewport. Note: This property is ignored if the Default value is |
getWrapItemsText |
Gets current value of property wrapItemsText. Determines whether the text in the items wraps on multiple lines when the available width is not enough. When the text is truncated ( Default value is |
indexOfItem |
Checks for the provided |
insertItem |
Inserts an item into the aggregation named |
isOpen |
Indicates whether the control's picker popup is opened. |
open |
Open the control's picker popup. |
removeAllAriaLabelledBy |
Removes all the controls in the association named ariaLabelledBy. |
removeAllItems |
Removes all the items in the aggregation named |
removeAriaLabelledBy |
Removes an ariaLabelledBy from the association named ariaLabelledBy. |
removeItem |
Removes an item from the aggregation named |
setAutoAdjustWidth |
Sets a new value for property autoAdjustWidth. Indicates whether the width of the input field is determined by the selected item's content. When called with a value of Default value is |
setColumnRatio |
Sets a new value for property columnRatio. Determines the ratio between the first and the second column when secondary values are displayed. Note: This property takes effect only when the When called with a value of Default value is |
setEditable |
Sets a new value for property editable. Determines whether the user can modify the selected item. When the property is set to Note: When both When called with a value of Default value is |
setEnabled |
Sets a new value for property enabled. Determines whether the user can modify the selected item. When the property is set to Note: When both When called with a value of Default value is |
setForceSelection |
Sets a new value for property forceSelection. Indicates whether the selection is restricted to one of the items in the list. Note: We strongly recommend that you always set this property to When called with a value of Default value is |
setIcon |
Sets a new value for property icon. The URI to the icon that will be displayed only when using the When called with a value of Default value is |
setMaxWidth |
Sets a new value for property maxWidth. Sets the maximum width of the control. Note: This property is ignored if the When called with a value of Default value is |
setName |
Sets a new value for property name. The name to be used in the HTML code (for example, for HTML forms that send data to the server via submit). When called with a value of Default value is |
setRequired |
Sets a new value for property required. Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation When called with a value of Default value is |
setResetOnMissingKey |
Sets a new value for property resetOnMissingKey. Modifies the behavior of the When called with a value of Default value is |
setSelectedItem |
Sets the Default value is |
setSelectedItemId |
Sets the Default value is an empty string |
setSelectedKey |
Sets property Default value is an empty string |
setShowSecondaryValues |
Sets a new value for property showSecondaryValues. Indicates whether the text values of the When called with a value of Default value is |
setTextAlign |
Sets a new value for property textAlign. Sets the horizontal alignment of the text within the input field. When called with a value of Default value is |
setTextDirection |
Sets a new value for property textDirection. Specifies the direction of the text within the input field with enumerated options. By default, the control inherits text direction from the DOM. When called with a value of Default value is |
setType |
Sets a new value for property type. Type of a select. Possible values When called with a value of Default value is |
setValueState |
Sets a new value for property valueState. Visualizes the validation state of the control, e.g. When called with a value of Default value is |
setValueStateText |
Sets a new value for property valueStateText. Defines the text of the value state message popup. If this is not specified, a default text is shown from the resource bundle. When called with a value of Default value is |
setWidth |
Sets a new value for property width. Sets the width of the field. By default, the field width is automatically adjusted to the size of its content and the default width of the field is calculated based on the widest list item in the dropdown list. If the width defined is smaller than its content, only the field width is changed whereas the dropdown list keeps the width of its content. If the dropdown list is wider than the visual viewport, it is truncated and an ellipsis is displayed for each item. For phones, the width of the dropdown list is always the same as the viewport. Note: This property is ignored if the When called with a value of Default value is |
setWrapItemsText |
Sets the |
unbindItems |
Unbinds aggregation items from model data. |
Adds some ariaLabelledBy into the association ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to add; if empty, nothing is inserted |
Adds an item to the aggregation named items
.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item to be added; if empty, nothing is added. |
Attaches event handler fnFunction
to the change event of this sap.m.Select
.
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.Select
itself.
This event is fired when the value in the selection field is changed in combination with one of the following actions:
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Binds aggregation items to model data.
See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo
.
Param | Type | DefaultValue | Description |
---|---|---|---|
oBindingInfo | sap.ui.base.ManagedObject.AggregationBindingInfo |
The binding information |
Creates a picker popup container where the selection should take place.
Param | Type | DefaultValue | Description |
---|---|---|---|
sPickerType | string |
The picker type |
Detaches event handler fnFunction
from the change event of this sap.m.Select
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Creates a new subclass of class sap.m.Select 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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event change to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
selectedItem | sap.ui.core.Item |
The selected item. |
|
previousSelectedItem | sap.ui.core.Item |
The previous selected item. |
Returns the sap.m.Select
accessibility information.
References:
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Gets current value of property autoAdjustWidth.
Indicates whether the width of the input field is determined by the selected item's content.
Default value is false
.
Gets current value of property columnRatio.
Determines the ratio between the first and the second column when secondary values are displayed.
Note: This property takes effect only when the showSecondaryValues
property is set to true
.
Default value is "3:2"
.
Gets current value of property editable.
Determines whether the user can modify the selected item. When the property is set to false
, the control appears as disabled but CAN still be focused.
Note: When both enabled
and editable
properties are set to false
, enabled
has priority over editable
.
Default value is true
.
Gets current value of property enabled.
Determines whether the user can modify the selected item. When the property is set to false
, the control appears as disabled and CANNOT be focused.
Note: When both enabled
and editable
properties are set to false
, enabled
has priority over editable
.
Default value is true
.
Gets the enabled items from the aggregation named items
.
Param | Type | DefaultValue | Description |
---|---|---|---|
aItems | sap.ui.core.Item[] | getItems() |
Items to filter. |
Gets current value of property forceSelection.
Indicates whether the selection is restricted to one of the items in the list. Note: We strongly recommend that you always set this property to false
and bind the selectedKey
property to the desired value for better interoperability with data binding.
Default value is true
.
Gets current value of property icon.
The URI to the icon that will be displayed only when using the IconOnly
type.
Default value is empty string
.
Returns the DOMNode Id to be used for the "labelFor" attribute of the label.
By default, this is the Id of the control itself.
Gets the item from the aggregation named items
at the given 0-based index.
Param | Type | DefaultValue | Description |
---|---|---|---|
iIndex | int |
Index of the item to return. |
Gets the item with the given key from the aggregation named items
.
Note: If duplicate keys exist, the first item matching the key is returned.
Param | Type | DefaultValue | Description |
---|---|---|---|
sKey | string |
An item key that specifies the item to be retrieved. |
Gets current value of property maxWidth.
Sets the maximum width of the control.
Note: This property is ignored if the autoAdjustWidth
property is set to true
.
Default value is "100%"
.
Gets current value of property name.
The name to be used in the HTML code (for example, for HTML forms that send data to the server via submit).
Default value is empty string
.
Enables the sap.m.Select
to move inside the sap.m.OverflowToolbar. Required by the sap.m.IOverflowToolbarContent interface.
Gets current value of property required.
Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation labelFor
of sap.m.Label
) cannot be established (e.g. one label should label multiple fields).
Default value is false
.
Gets current value of property resetOnMissingKey.
Modifies the behavior of the setSelectedKey
method so that the selected item is cleared when a provided selected key is missing.
Default value is false
.
Gets current value of property selectedItemId.
ID of the selected item.
Default value is empty string
.
Gets current value of property selectedKey.
Key of the selected item.
Notes:
selectedKey
is used, the first item is being selected.selectedKey
leads to severe functional issues in sap.ui.table.Table
, when the sap.m.Select
is used inside a sap.ui.table.Table
column.Default value is empty string
.
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
.
Gets current value of property textAlign.
Sets the horizontal alignment of the text within the input field.
Default value is Initial
.
Gets current value of property textDirection.
Specifies the direction of the text within the input field with enumerated options. By default, the control inherits text direction from the DOM.
Default value is Inherit
.
Gets current value of property type.
Type of a select. Possible values Default
, IconOnly
.
Default value is Default
.
Gets current value of property valueState.
Visualizes the validation state of the control, e.g. Error
, Warning
, Success
, Information
.
Default value is None
.
Gets current value of property valueStateText.
Defines the text of the value state message popup. If this is not specified, a default text is shown from the resource bundle.
Default value is empty string
.
Gets current value of property width.
Sets the width of the field. By default, the field width is automatically adjusted to the size of its content and the default width of the field is calculated based on the widest list item in the dropdown list. If the width defined is smaller than its content, only the field width is changed whereas the dropdown list keeps the width of its content. If the dropdown list is wider than the visual viewport, it is truncated and an ellipsis is displayed for each item. For phones, the width of the dropdown list is always the same as the viewport.
Note: This property is ignored if the autoAdjustWidth
property is set to true
.
Default value is "auto"
.
Gets current value of property wrapItemsText.
Determines whether the text in the items wraps on multiple lines when the available width is not enough. When the text is truncated (wrapItemsText
property is set to false
), the max width of the SelectList
is 600px. When wrapItemsText
is set to true
, SelectList
takes all of the available width.
Default value is false
.
Checks for the provided sap.ui.core.Item
in the aggregation items. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item whose index is looked for |
Inserts an item into the aggregation named items
.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item to be inserted; if empty, nothing is inserted. |
|
iIndex | int |
The |
Removes all the items in the aggregation named items
. Additionally unregisters them from the hosting UIArea.
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | int sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to be removed or its index or ID |
Removes an item from the aggregation named items
.
Param | Type | DefaultValue | Description |
---|---|---|---|
vItem | int string sap.ui.core.Item |
The item to be removed or its index or ID. |
Sets a new value for property autoAdjustWidth.
Indicates whether the width of the input field is determined by the selected item's content.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bAutoAdjustWidth | boolean | false |
New value for property |
Sets a new value for property columnRatio.
Determines the ratio between the first and the second column when secondary values are displayed.
Note: This property takes effect only when the showSecondaryValues
property is set to true
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "3:2"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sColumnRatio | sap.m.SelectColumnRatio | "3:2" |
New value for property |
Sets a new value for property editable.
Determines whether the user can modify the selected item. When the property is set to false
, the control appears as disabled but CAN still be focused.
Note: When both enabled
and editable
properties are set to false
, enabled
has priority over editable
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEditable | boolean | true |
New value for property |
Sets a new value for property enabled.
Determines whether the user can modify the selected item. When the property is set to false
, the control appears as disabled and CANNOT be focused.
Note: When both enabled
and editable
properties are set to false
, enabled
has priority over editable
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEnabled | boolean | true |
New value for property |
Sets a new value for property forceSelection.
Indicates whether the selection is restricted to one of the items in the list. Note: We strongly recommend that you always set this property to false
and bind the selectedKey
property to the desired value for better interoperability with data binding.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bForceSelection | boolean | true |
New value for property |
Sets a new value for property icon.
The URI to the icon that will be displayed only when using the IconOnly
type.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is empty string
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sIcon | sap.ui.core.URI | "" |
New value for property |
Sets a new value for property maxWidth.
Sets the maximum width of the control.
Note: This property is ignored if the autoAdjustWidth
property is set to true
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "100%"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sMaxWidth | sap.ui.core.CSSSize | "100%" |
New value for property |
Sets a new value for property name.
The name to be used in the HTML code (for example, for HTML forms that send data to the server via submit).
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is empty string
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sName | string | "" |
New value for property |
Sets a new value for property required.
Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation labelFor
of sap.m.Label
) cannot be established (e.g. one label should label multiple fields).
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bRequired | boolean | false |
New value for property |
Sets a new value for property resetOnMissingKey.
Modifies the behavior of the setSelectedKey
method so that the selected item is cleared when a provided selected key is missing.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bResetOnMissingKey | boolean | false |
New value for property |
Sets the selectedItem
association.
Default value is null
.
Param | Type | DefaultValue | Description |
---|---|---|---|
vItem | string sap.ui.core.Item null |
New value for the |
Sets the selectedItemId
property.
Default value is an empty string ""
or undefined
.
Param | Type | DefaultValue | Description |
---|---|---|---|
vItem | string |
New value for property |
Sets property selectedKey
.
Default value is an empty string ""
or undefined
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sKey | string |
New value for property In the case that an item has the default key value, it is selected instead. If duplicate keys exist, the first item matching the key is selected. |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bShowSecondaryValues | boolean | false |
New value for property |
Sets a new value for property textAlign.
Sets the horizontal alignment of the text within the input field.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Initial
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTextAlign | sap.ui.core.TextAlign | Initial |
New value for property |
Sets a new value for property textDirection.
Specifies the direction of the text within the input field with enumerated options. By default, the control inherits text direction from the DOM.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Inherit
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTextDirection | sap.ui.core.TextDirection | Inherit |
New value for property |
Sets a new value for property type.
Type of a select. Possible values Default
, IconOnly
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Default
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sType | sap.m.SelectType | Default |
New value for property |
Sets a new value for property valueState.
Visualizes the validation state of the control, e.g. Error
, Warning
, Success
, Information
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is None
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValueState | sap.ui.core.ValueState | None |
New value for property |
Sets a new value for property valueStateText.
Defines the text of the value state message popup. If this is not specified, a default text is shown from the resource bundle.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is empty string
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValueStateText | string | "" |
New value for property |
Sets a new value for property width.
Sets the width of the field. By default, the field width is automatically adjusted to the size of its content and the default width of the field is calculated based on the widest list item in the dropdown list. If the width defined is smaller than its content, only the field width is changed whereas the dropdown list keeps the width of its content. If the dropdown list is wider than the visual viewport, it is truncated and an ellipsis is displayed for each item. For phones, the width of the dropdown list is always the same as the viewport.
Note: This property is ignored if the autoAdjustWidth
property is set to true
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "auto"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize | "auto" |
New value for property |