Class sap.ui.commons.ListBoxModule: sap/ui/commons/ListBox

extends Control

Provides a list of items from which users can choose an item. For the design of the list box, features such as defining the list box height, fixing the number of visible items, choosing one item to be the item that is marked by default when the list box is shown, or a scroll bar for large list boxes are available.

Deprecated API:Since version 1.38. Instead, use the sap.m.List control.

Constructor Summary
new sap.ui.commons.ListBox(sId?, mSettings?)Constructor for a new ListBox.
Event Summary
select(oControlEvent)Event is fired when selection is changed by user interaction.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.ListBox.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.ListBox with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.ListBox.getMetadata()Returns a metadata object for class sap.ui.commons.ListBox.
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.
addSelectedIndex(iSelectedIndex)Adds the given index to current selection.
addSelectedIndices(aSelectedIndices)Adds the given indices to selection.
attachSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the select event of this sap.ui.commons.ListBox.
clearSelection()Removes complete selection.
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.ListBox.
fireSelect(mArguments?)Fires event select to attached listeners.
getAllowMultiSelect()Gets current value of property allowMultiSelect.
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.
getDisplayIcons()Gets current value of property displayIcons.
getDisplaySecondaryValues()Gets current value of property displaySecondaryValues.
getEditable()Gets current value of property editable.
getEnabled()Gets current value of property enabled.
getHeight()Gets current value of property height.
getItems()Gets content of aggregation items.
getMaxWidth()Gets current value of property maxWidth.
getMinWidth()Gets current value of property minWidth.
getScrollTop()Returns how many pixels the ListBox contents are currently scrolled down.
getSecondaryValueTextAlign()Gets current value of property secondaryValueTextAlign.
getSelectedIndex()Zero-based index of selected item.
getSelectedIndices()Zero-based indices of selected items, wrapped in an array.
getSelectedItem()Returns selected item.
getSelectedItems()Returns an array containing the selected items.
getSelectedKeys()Returns the keys of the selected items in an array.
getValueTextAlign()Gets current value of property valueTextAlign.
getVisibleItems()Returns the number of visible items.
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.
isIndexSelected(iIndex)Returns whether the given index is selected.
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.
removeSelectedIndex(iIndex)Removes the given index from this selection.
scrollToIndex(iIndex, bLazy)If the ListBox has a scroll bar because the number of items is larger than the number of visible items, this method scrolls to the item with the given index.
setAllowMultiSelect(bAllowMultiSelect)Sets a new value for property allowMultiSelect.
setDisplayIcons(bDisplayIcons)Sets a new value for property displayIcons.
setDisplaySecondaryValues(bDisplaySecondaryValues)Sets a new value for property displaySecondaryValues.
setEditable(bEditable)Sets a new value for property editable.
setEnabled(bEnabled)Sets a new value for property enabled.
setHeight(sHeight)Sets the height of this ListBox in CSS units.
setItems(aItems, bDestroyItems)Allows setting the list items as array for this instance of ListBox.
setMaxWidth(sMaxWidth)Sets a new value for property maxWidth.
setMinWidth(sMinWidth)Sets a new value for property minWidth.
setScrollTop(iScrollTop)Positions the ListBox contents so that they are scrolled-down by the given number of pixels.
setSecondaryValueTextAlign(sSecondaryValueTextAlign)Sets a new value for property secondaryValueTextAlign.
setSelectedIndex(iSelectedIndex)Sets the zero-based index of the currently selected item.
setSelectedIndices(aSelectedIndices)Zero-based indices of selected items, wrapped in an array.
setSelectedKeys(aSelectedKeys)Keys of the items to be selected, wrapped in an array.
setValueTextAlign(sValueTextAlign)Sets a new value for property valueTextAlign.
setVisibleItems(iItemCount)Makes the ListBox render with a height that allows it to display exactly the given number of items.
setWidth(sWidth)Sets the width of this ListBox in CSS units.
Constructor Detail
new sap.ui.commons.ListBox(sId?, mSettings?)
Constructor for a new ListBox.

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:

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

Parameters:
{string}sId? ID for the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Deprecated:
Since version 1.38. Instead, use the sap.m.List control.
Event Detail
select(oControlEvent)
Event is fired when selection is changed by user interaction.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.id ID of the ListBox which triggered the event.
{int}oControlEvent.getParameters.selectedIndex The currently selected index of the ListBox. In the case of multiple selection, this is exactly one of the selected indices - the one whose selection has triggered the selection change. To get all currently selected indices, use selectedIndices.
{sap.ui.core.Item}oControlEvent.getParameters.selectedItem The currently selected item of the ListBox. In the case of multiple selection, this is exactly one of the selected items - the one whose selection has triggered the selection change.
{int[]}oControlEvent.getParameters.selectedIndices Array containing the indices which are selected.
Method Detail
sap.ui.commons.ListBox.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.ListBox 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
sap.ui.commons.ListBox.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.ListBox.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addAriaDescribedBy(vAriaDescribedBy): sap.ui.commons.ListBox
Adds some ariaDescribedBy into the association ariaDescribedBy.
Parameters:
{string|sap.ui.core.Control}vAriaDescribedBy the ariaDescribedBy to add; if empty, nothing is inserted
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
addAriaLabelledBy(vAriaLabelledBy): sap.ui.commons.ListBox
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
{string|sap.ui.core.Control}vAriaLabelledBy the ariaLabelledBy to add; if empty, nothing is inserted
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
addItem(oItem): sap.ui.commons.ListBox
Adds some item to the aggregation items.
Parameters:
{sap.ui.core.Item}oItem the item to add; if empty, nothing is inserted
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
addSelectedIndex(iSelectedIndex): sap.ui.commons.ListBox
Adds the given index to current selection. When multiple selection is disabled, this replaces the current selection. When the given index is invalid, the call is ignored.
Parameters:
{int}iSelectedIndex Index to add to selection..
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
addSelectedIndices(aSelectedIndices): sap.ui.commons.ListBox
Adds the given indices to selection. Any invalid indices are ignored.
Parameters:
{int[]}aSelectedIndices Indices of the items that shall additionally be selected.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
attachSelect(oData?, fnFunction, oListener?): sap.ui.commons.ListBox
Attaches event handler fnFunction to the select event of this sap.ui.commons.ListBox.

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.ListBox itself.

Event is fired when selection is changed by user interaction.

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.ui.commons.ListBox itself
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
clearSelection(): sap.ui.commons.ListBox
Removes complete selection.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
destroyItems(): sap.ui.commons.ListBox
Destroys all the items in the aggregation items.
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
detachSelect(fnFunction, oListener): sap.ui.commons.ListBox
Detaches event handler fnFunction from the select event of this sap.ui.commons.ListBox.

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:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
fireSelect(mArguments?): sap.ui.commons.ListBox
Fires event select to attached listeners.

Expects the following event parameters:

  • id of type stringID of the ListBox which triggered the event.
  • selectedIndex of type intThe currently selected index of the ListBox. In the case of multiple selection, this is exactly one of the selected indices - the one whose selection has triggered the selection change. To get all currently selected indices, use selectedIndices.
  • selectedItem of type sap.ui.core.ItemThe currently selected item of the ListBox. In the case of multiple selection, this is exactly one of the selected items - the one whose selection has triggered the selection change.
  • selectedIndices of type int[]Array containing the indices which are selected.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
getAllowMultiSelect(): boolean
Gets current value of property allowMultiSelect.

Determines whether multiple selection is allowed.

Default value is false.

Returns:
{boolean} Value of property allowMultiSelect
getAriaDescribedBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns:
{sap.ui.core.Control[]}
getAriaLabelledBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
{sap.ui.core.Control[]}
getDisplayIcons(): boolean
Gets current value of property displayIcons.

Determines whether the icons of the list items shall also be displayed. Enabling icons requires some space to be reserved for them. Displaying icons can also influence the width and height of a single item, which affects the overall height of the ListBox when defined in number of items. Note that the number of icons that can be displayed in the ListBox depends on the size of the icons themselves and of the total ListBox height.

Default value is false.

Returns:
{boolean} Value of property displayIcons
getDisplaySecondaryValues(): boolean
Gets current value of property displaySecondaryValues.

Determines whether the text values from the additionalText property (see sap.ui.core.ListItems) shall be displayed.

Default value is false.

Returns:
{boolean} Value of property displaySecondaryValues
getEditable(): boolean
Gets current value of property editable.

Determines whether the ListBox is interactive or not. Can be used to disable interaction with mouse or keyboard.

Default value is true.

Returns:
{boolean} Value of property editable
getEnabled(): boolean
Gets current value of property enabled.

Determines whether the ListBox is enabled or not. Can be used to disable interaction with mouse or keyboard. Disabled controls have another color display depending on custom settings.

Default value is true.

Returns:
{boolean} Value of property enabled
getHeight(): sap.ui.core.CSSSize
Gets current value of property height.

Control height as common CSS-size (px or % as unit, for example). The setting overrides any definitions made for the setVisibleItems() method.

Returns:
{sap.ui.core.CSSSize} Value of property height
getItems(): sap.ui.core.Item[]
Gets content of aggregation items.

Aggregation of items to be displayed. Must be either of type sap.ui.core.ListItem or sap.ui.core.SeparatorItem.

Returns:
{sap.ui.core.Item[]}
getMaxWidth(): sap.ui.core.CSSSize
Gets current value of property maxWidth.

Determines the maximum width of the ListBox. If not set, there is no maximum width.

Returns:
{sap.ui.core.CSSSize} Value of property maxWidth
getMinWidth(): sap.ui.core.CSSSize
Gets current value of property minWidth.

Determines the minimum width of the ListBox. If not set, there is no minimum width.

Returns:
{sap.ui.core.CSSSize} Value of property minWidth
getScrollTop(): int
Returns how many pixels the ListBox contents are currently scrolled down.
Returns:
{int} Vertical scroll position.
getSecondaryValueTextAlign(): sap.ui.core.TextAlign
Gets current value of property secondaryValueTextAlign.

Determines the text alignment in the secondary ListBox text column (if available).

Default value is Begin.

Returns:
{sap.ui.core.TextAlign} Value of property secondaryValueTextAlign
getSelectedIndex(): int
Zero-based index of selected item. Index value for no selection is -1. When multiple selection is enabled and multiple items are selected, the method returns the first selected item.
Returns:
{int} Selected index
getSelectedIndices(): int[]
Zero-based indices of selected items, wrapped in an array. An empty array means "no selection".
Returns:
{int[]} Array of selected indices.
getSelectedItem(): sap.ui.core.Item
Returns selected item. When no item is selected, "null" is returned. When multi-selection is enabled and multiple items are selected, only the first selected item is returned.
Returns:
{sap.ui.core.Item} Selected item
getSelectedItems(): sap.ui.core.Item[]
Returns an array containing the selected items. In the case of no selection, an empty array is returned.
Returns:
{sap.ui.core.Item[]} Selected items.
getSelectedKeys(): string[]
Returns the keys of the selected items in an array. If a selected item does not have a key, the respective array entry will be undefined.
Returns:
{string[]} Array with selected keys.
getValueTextAlign(): sap.ui.core.TextAlign
Gets current value of property valueTextAlign.

Determines the text alignment in the primary ListBox column.

Default value is Begin.

Returns:
{sap.ui.core.TextAlign} Value of property valueTextAlign
getVisibleItems(): int
Returns the number of visible items.
Returns:
{int} Number of visible items.
getWidth(): sap.ui.core.CSSSize
Gets current value of property width.

Control width as common CSS-size (px or % as unit, for example).

Returns:
{sap.ui.core.CSSSize} Value 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.Item}oItem The item whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertItem(oItem, iIndex): sap.ui.commons.ListBox
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:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
isIndexSelected(iIndex): boolean
Returns whether the given index is selected.
Parameters:
{int}iIndex Index which is checked for selection state.
Returns:
{boolean} Whether index is selected.
removeAllAriaDescribedBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaDescribedBy.
Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAllAriaLabelledBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
{sap.ui.core.Control[]} 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.Control
Removes an ariaDescribedBy from the association named ariaDescribedBy.
Parameters:
{int|string|sap.ui.core.Control}vAriaDescribedBy The ariaDescribedByto be removed or its index or ID
Returns:
{sap.ui.core.Control} the removed ariaDescribedBy or null
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.Control
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
Returns:
{sap.ui.core.Control} the removed ariaLabelledBy or null
removeItem(vItem): sap.ui.core.Item
Removes a item from the aggregation items.
Parameters:
{int|string|sap.ui.core.Item}vItem The itemto remove or its index or id
Returns:
{sap.ui.core.Item} The removed item or null
removeSelectedIndex(iIndex): sap.ui.commons.ListBox
Removes the given index from this selection. When the index is invalid or not selected, the call is ignored.
Parameters:
{int}iIndex Index that shall be removed from selection.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
scrollToIndex(iIndex, bLazy): sap.ui.commons.ListBox
If the ListBox has a scroll bar because the number of items is larger than the number of visible items, this method scrolls to the item with the given index. If there are enough items, this item will then appear at the topmost visible position in the ListBox. If bLazy is true, it only scrolls as far as required to make the item visible. Setting the scrollTop property and calling scrollToIndex are two operations influencing the same "physical" property, so the last call "wins".
Parameters:
{int}iIndex The index to which the ListBox should scroll.
{boolean}bLazy If set to true, the ListBox only scrolls if the item is not completely visible, and it scrolls for exactly the space to make it fully visible. If set to false, the item is scrolled to the top position (if possible).
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
setAllowMultiSelect(bAllowMultiSelect): sap.ui.commons.ListBox
Sets a new value for property allowMultiSelect.

Determines whether multiple selection is allowed.

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

Default value is false.

Parameters:
{boolean}bAllowMultiSelect New value for property allowMultiSelect
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setDisplayIcons(bDisplayIcons): sap.ui.commons.ListBox
Sets a new value for property displayIcons.

Determines whether the icons of the list items shall also be displayed. Enabling icons requires some space to be reserved for them. Displaying icons can also influence the width and height of a single item, which affects the overall height of the ListBox when defined in number of items. Note that the number of icons that can be displayed in the ListBox depends on the size of the icons themselves and of the total ListBox height.

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

Default value is false.

Parameters:
{boolean}bDisplayIcons New value for property displayIcons
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setDisplaySecondaryValues(bDisplaySecondaryValues): sap.ui.commons.ListBox
Sets a new value for property displaySecondaryValues.

Determines whether the text values from the additionalText property (see sap.ui.core.ListItems) shall be displayed.

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

Default value is false.

Parameters:
{boolean}bDisplaySecondaryValues New value for property displaySecondaryValues
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setEditable(bEditable): sap.ui.commons.ListBox
Sets a new value for property editable.

Determines whether the ListBox is interactive or not. Can be used to disable interaction with mouse or keyboard.

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

Default value is true.

Parameters:
{boolean}bEditable New value for property editable
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setEnabled(bEnabled): sap.ui.commons.ListBox
Sets a new value for property enabled.

Determines whether the ListBox is enabled or not. Can be used to disable interaction with mouse or keyboard. Disabled controls have another color display depending on custom settings.

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:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setHeight(sHeight): sap.ui.commons.ListBox
Sets the height of this ListBox in CSS units.
Parameters:
{sap.ui.core.CSSSize}sHeight New height for the ListBox.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
setItems(aItems, bDestroyItems): sap.ui.commons.ListBox
Allows setting the list items as array for this instance of ListBox.
Parameters:
{sap.ui.core.ListItem[]}aItems The items to set for this ListBox.
{boolean}bDestroyItems Optional boolean parameter to indicate that the formerly set items should be destroyed, instead of just removed.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
setMaxWidth(sMaxWidth): sap.ui.commons.ListBox
Sets a new value for property maxWidth.

Determines the maximum width of the ListBox. If not set, there is no maximum width.

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

Parameters:
{sap.ui.core.CSSSize}sMaxWidth New value for property maxWidth
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setMinWidth(sMinWidth): sap.ui.commons.ListBox
Sets a new value for property minWidth.

Determines the minimum width of the ListBox. If not set, there is no minimum width.

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

Parameters:
{sap.ui.core.CSSSize}sMinWidth New value for property minWidth
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setScrollTop(iScrollTop): sap.ui.commons.ListBox
Positions the ListBox contents so that they are scrolled-down by the given number of pixels.
Parameters:
{int}iScrollTop Vertical scroll position in pixels.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
setSecondaryValueTextAlign(sSecondaryValueTextAlign): sap.ui.commons.ListBox
Sets a new value for property secondaryValueTextAlign.

Determines the text alignment in the secondary ListBox text column (if available).

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

Default value is Begin.

Parameters:
{sap.ui.core.TextAlign}sSecondaryValueTextAlign New value for property secondaryValueTextAlign
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setSelectedIndex(iSelectedIndex): sap.ui.commons.ListBox
Sets the zero-based index of the currently selected item. This method removes any previous selections. When the given index is invalid, the call is ignored.
Parameters:
{int}iSelectedIndex Index to be selected.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
setSelectedIndices(aSelectedIndices): sap.ui.commons.ListBox
Zero-based indices of selected items, wrapped in an array. An empty array means "no selection". When multiple selection is disabled and multiple items are given, the selection is set to the index of the first valid index in the given array. Any invalid indices are ignored. The previous selection is in any case replaced.
Parameters:
{int[]}aSelectedIndices Indices of the items to be selected.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
setSelectedKeys(aSelectedKeys): sap.ui.commons.ListBox
Keys of the items to be selected, wrapped in an array. An empty array means no selection. When multiple selection is disabled, and multiple keys are given, the selection is set to the item with the first valid key in the given array. Any invalid keys are ignored. The previous selection is replaced in any case.
Parameters:
{string[]}aSelectedKeys The keys of the items to be selected.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
setValueTextAlign(sValueTextAlign): sap.ui.commons.ListBox
Sets a new value for property valueTextAlign.

Determines the text alignment in the primary ListBox column.

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

Default value is Begin.

Parameters:
{sap.ui.core.TextAlign}sValueTextAlign New value for property valueTextAlign
Returns:
{sap.ui.commons.ListBox} Reference to this in order to allow method chaining
setVisibleItems(iItemCount): sap.ui.commons.ListBox
Makes the ListBox render with a height that allows it to display exactly the given number of items.
Parameters:
{int}iItemCount The number of items that should fit into the ListBox without scrolling.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.
setWidth(sWidth): sap.ui.commons.ListBox
Sets the width of this ListBox in CSS units.
Parameters:
{sap.ui.core.CSSSize}sWidth New width for the ListBox.
Returns:
{sap.ui.commons.ListBox}this to allow method chaining.