class sap.m.ActionSelect

Control sample: sap.m.ActionSelect
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Extends: sap.m.Select
Module: sap/m/ActionSelect
Application Component: CA-UI5-CTR

The ActionSelect control provides a list of predefined items that allows end users to choose options and additionally trigger some actions.


Constructor

Constructor for a new ActionSelect.

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.ActionSelect(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

Borrowed Properties

Name Type Default Value Description
autoAdjustWidth boolean false

Indicates whether the width of the input field is determined by the selected item's content.

Since: 1.16.

Visibility: public
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 showSecondaryValues property is set to true.

Since: 1.86.

Visibility: public
editable boolean true

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.

Since: 1.66.0.

Visibility: public
enabled boolean true

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.

Visibility: public
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 false and bind the selectedKey property to the desired value for better interoperability with data binding.

Since: 1.34.

Visibility: public
icon sap.ui.core.URI empty string

The URI to the icon that will be displayed only when using the IconOnly type.

Since: 1.16.

Visibility: public
maxWidth sap.ui.core.CSSSize 100%

Sets the maximum width of the control.

Note: This property is ignored if the autoAdjustWidth property is set to true.

Visibility: public
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 labelFor of sap.m.Label) cannot be established (e.g. one label should label multiple fields).

Since: 1.74.

Visibility: public
resetOnMissingKey boolean false

Modifies the behavior of the setSelectedKey method so that the selected item is cleared when a provided selected key is missing.

Since: 1.77.

Visibility: public
selectedItemId string empty string

ID of the selected item.

Since: 1.12.

Visibility: public
selectedKey string empty string

Key of the selected item.

Notes:

  • If duplicate keys exist, the first item matching the key is used.
  • If invalid or none selectedKey is used, the first item is being selected.
  • Invalid or missing 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.


Since: 1.11.

Visibility: public
showSecondaryValues boolean false

Indicates whether the text values of the additionalText property of a sap.ui.core.ListItem are shown.

Since: 1.40.

Visibility: public
textAlign sap.ui.core.TextAlign Initial

Sets the horizontal alignment of the text within the input field.

Since: 1.28.

Visibility: public
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.

Since: 1.28.

Visibility: public
type sap.m.SelectType Default

Type of a select. Possible values Default, IconOnly.

Since: 1.16.

Visibility: public
valueState sap.ui.core.ValueState None

Visualizes the validation state of the control, e.g. Error, Warning, Success, Information.

Since: 1.40.2.

Visibility: public
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.

Since: 1.40.5.

Visibility: public
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 autoAdjustWidth property is set to true.

Visibility: public
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 (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.

Since: 1.69.

Visibility: public

Borrowed Aggregations

Name Cardinality Type Description
items 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:

 <ListItem text="Paper plane" icon="sap-icon://paper-plane"></ListItem> 


Associations

Name Cardinality Type Description
buttons 0..n sap.m.Button

Buttons to be added to the ActionSelect content.


Methods Overview

Method Description
addButton

Adds some button into the association buttons.

sap.m.ActionSelect.extend

Creates a new subclass of class sap.m.ActionSelect with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.Select.extend.

getButtons

Returns array of IDs of the elements which are the current targets of the association buttons.

sap.m.ActionSelect.getMetadata

Returns a metadata object for class sap.m.ActionSelect.

removeAllButtons

Remove all buttons from the ActionSelect.

removeButton

Button to be removed from the ActionSelect content.

addButton

Adds some button into the association buttons.

Param Type DefaultValue Description
vButton sap.ui.core.ID sap.m.Button

The buttons to add; if empty, nothing is inserted

sap.m.ActionSelect.extend

Creates a new subclass of class sap.m.ActionSelect with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.Select.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

getButtons

Returns array of IDs of the elements which are the current targets of the association buttons.

sap.m.ActionSelect.getMetadata

Returns a metadata object for class sap.m.ActionSelect.

removeAllButtons

Remove all buttons from the ActionSelect.

removeButton

Button to be removed from the ActionSelect content.

Param Type DefaultValue Description
vButton int string sap.m.Button

The button to remove or its index or id.