The ActionSelect control provides a list of predefined items that allows end users to choose options and additionally trigger some actions.
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 |
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 ( |
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:
|
Name | Cardinality | Type | Description |
---|---|---|---|
buttons | 0..n | sap.m.Button |
Buttons to be added to the ActionSelect content. |
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
|
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. |
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 |
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 |
Returns array of IDs of the elements which are the current targets of the association buttons.
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. |