Class sap.m.TableSelectDialogModule: sap/m/TableSelectDialog

extends Control

TableSelectDialog provides you with an easier way to create a dialog that contains a list with grouping and search functionalities. The Table used in a SelectDialog is a Table with Columns. After selecting an item, the dialog is closed and a callback function returns the item being selected.


Since: 1.16.
Constructor Summary
new sap.m.TableSelectDialog(sId?, mSettings?)Constructor for a new TableSelectDialog.
Field Summary
_setBindingContextSets the binding context for the internal table AND the current control so that both controls can be used with the context.
_setModelSets the model for the internal table and the current control, so that both controls can be used with data binding.
Event Summary
cancel(oControlEvent)Fires when the Cancel button is clicked.
confirm(oControlEvent)Fires when the dialog is confirmed by selecting an item in single-selection mode or by pressing the confirmation button in multi-selection mode.
liveChange(oControlEvent)Fires when the value of the search field is changed by a user (for example at each key press).
search(oControlEvent)Fires when the search button has been clicked on dialog.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.TableSelectDialog.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.TableSelectDialog with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.TableSelectDialog.getMetadata()Returns a metadata object for class sap.m.TableSelectDialog.
addColumn(oColumn)Adds some column to the aggregation columns.
addItem(oItem)Adds some item to the aggregation items.
attachCancel(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the cancel event of this sap.m.TableSelectDialog.
attachConfirm(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the confirm event of this sap.m.TableSelectDialog.
attachLiveChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the liveChange event of this sap.m.TableSelectDialog.
attachSearch(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the search event of this sap.m.TableSelectDialog.
bindAggregation(sAggregationName, oBindingInfo)Forwards aggregations with the name of items or columns to the internal table.
bindColumns(oBindingInfo)Binds aggregation columns to model data.
bindItems(oBindingInfo)Binds aggregation items to model data.
destroyColumns()Destroys all the columns in the aggregation columns.
destroyItems()Destroys all the items in the aggregation items.
detachCancel(fnFunction, oListener)Detaches event handler fnFunction from the cancel event of this sap.m.TableSelectDialog.
detachConfirm(fnFunction, oListener)Detaches event handler fnFunction from the confirm event of this sap.m.TableSelectDialog.
detachLiveChange(fnFunction, oListener)Detaches event handler fnFunction from the liveChange event of this sap.m.TableSelectDialog.
detachSearch(fnFunction, oListener)Detaches event handler fnFunction from the search event of this sap.m.TableSelectDialog.
fireCancel(mArguments?)Fires event cancel to attached listeners.
fireConfirm(mArguments?)Fires event confirm to attached listeners.
fireLiveChange(mArguments?)Fires event liveChange to attached listeners.
fireSearch(mArguments?)Fires event search to attached listeners.
getColumns()Gets content of aggregation columns.
getContentHeight()Retrieves content height of the select dialog sap.m.Dialog
getContentWidth()Retrieves content width of the select dialog sap.m.Dialog
getGrowingThreshold()Gets current value of property growingThreshold.
getItems()Gets content of aggregation items.
getMultiSelect()Gets current value of property multiSelect.
getNoDataText()Retrieves the internal List's no data text property
getRememberSelections()Gets current value of property rememberSelections.
getTitle()Gets current value of property title.
indexOfColumn(oColumn)Checks for the provided sap.m.Column in the aggregation columns.
indexOfItem(oItem)Checks for the provided sap.m.ColumnListItem in the aggregation items.
insertColumn(oColumn, iIndex)Inserts a column into the aggregation columns.
insertItem(oItem, iIndex)Inserts a item into the aggregation items.
invalidate()Invalidates the dialog instead of this control, as there is no renderer.
onAfterRendering()Shows the busy state and is called after the renderer is finished.
open(sSearchValue)Opens the internal dialog with a searchfield and a table.
removeAllColumns()Removes all the controls from the aggregation columns.
removeAllItems()Removes all the controls from the aggregation items.
removeColumn(vColumn)Removes a column from the aggregation columns.
removeItem(vItem)Removes a item from the aggregation items.
setBusyIndicatorDelay(iValue)Sets the busyIndicatorDelay value to the internal table
setContentHeight(sHeight)Sets content height of the select dialog sap.m.Dialog
setContentWidth(sWidth)Sets content width of the select dialog sap.m.Dialog
setGrowingThreshold(iValue)Sets the growing threshold to the internal table
setMultiSelect(bMulti)Enables/Disables multi selection mode.
setNoDataText(sNoDataText)Sets the no data text of the internal table
setRememberSelections(bRememberSelections)Sets a new value for property rememberSelections.
setTitle(sTitle)Sets the title of the internal dialog
unbindColumns()Unbinds aggregation columns from model data.
unbindItems()Unbinds aggregation items from model data.
Constructor Detail
new sap.m.TableSelectDialog(sId?, mSettings?)
Constructor for a new TableSelectDialog.

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:

  • Properties
  • Aggregations
    • items : sap.m.ColumnListItem[] (default)
    • columns : sap.m.Column[]
  • Events
    • confirm : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • search : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • liveChange : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • cancel : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

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
Field Detail
_setBindingContext
Sets the binding context for the internal table AND the current control so that both controls can be used with the context.
_setModel
Sets the model for the internal table and the current control, so that both controls can be used with data binding.
Event Detail
cancel(oControlEvent)
Fires when the Cancel button is clicked.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
confirm(oControlEvent)
Fires when the dialog is confirmed by selecting an item in single-selection mode or by pressing the confirmation button in multi-selection mode. The items being selected are returned as event parameters.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.m.StandardListItem}oControlEvent.getParameters.selectedItem Returns the selected list 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.
{sap.m.StandardListItem[]}oControlEvent.getParameters.selectedItems Returns an array containing the visible selected list items. If no items are selected, an empty array is returned.
{string}oControlEvent.getParameters.selectedContexts Returns the binding contexts of the selected items including the non-visible items. Note: In contrast to the parameter "selectedItems", this parameter includes the selected but NOT visible items (due to list filtering). An empty array is set for this parameter if no Databinding is used.
liveChange(oControlEvent)
Fires when the value of the search field is changed by a user (for example at each key press).
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.value Specifies the value entered in the search field.
{any}oControlEvent.getParameters.itemsBinding The Items binding of the Table Select Dialog. Only available if the items aggregation is bound to a model.
search(oControlEvent)
Fires when the search button has been clicked on dialog.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.value Specifies the value entered in the search field.
{any}oControlEvent.getParameters.itemsBinding Determines the Items binding of the Table Select Dialog. Only available if the items aggregation is bound to a model.
Method Detail
sap.m.TableSelectDialog.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.TableSelectDialog 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.m.TableSelectDialog.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.TableSelectDialog.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addColumn(oColumn): sap.m.TableSelectDialog
Adds some column to the aggregation columns.
Parameters:
{sap.m.Column}oColumn the column to add; if empty, nothing is inserted
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
addItem(oItem): sap.m.TableSelectDialog
Adds some item to the aggregation items.
Parameters:
{sap.m.ColumnListItem}oItem the item to add; if empty, nothing is inserted
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
attachCancel(oData?, fnFunction, oListener?): sap.m.TableSelectDialog
Attaches event handler fnFunction to the cancel event of this sap.m.TableSelectDialog.

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

Fires when the Cancel button is clicked.

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.TableSelectDialog itself
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
attachConfirm(oData?, fnFunction, oListener?): sap.m.TableSelectDialog
Attaches event handler fnFunction to the confirm event of this sap.m.TableSelectDialog.

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

Fires when the dialog is confirmed by selecting an item in single-selection mode or by pressing the confirmation button in multi-selection mode. The items being selected are returned as event parameters.

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.TableSelectDialog itself
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
attachLiveChange(oData?, fnFunction, oListener?): sap.m.TableSelectDialog
Attaches event handler fnFunction to the liveChange event of this sap.m.TableSelectDialog.

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

Fires when the value of the search field is changed by a user (for example at each key press).

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.TableSelectDialog itself
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
attachSearch(oData?, fnFunction, oListener?): sap.m.TableSelectDialog
Attaches event handler fnFunction to the search event of this sap.m.TableSelectDialog.

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

Fires when the search button has been clicked on dialog.

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.TableSelectDialog itself
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
bindAggregation(sAggregationName, oBindingInfo): sap.m.TableSelectDialog
Forwards aggregations with the name of items or columns to the internal table.
Parameters:
{string}sAggregationName The name for the binding
{object}oBindingInfo The configuration parameters for the binding
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
bindColumns(oBindingInfo): sap.m.TableSelectDialog
Binds aggregation columns to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Parameters:
{object}oBindingInfo The binding information
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
bindItems(oBindingInfo): sap.m.TableSelectDialog
Binds aggregation items to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Parameters:
{object}oBindingInfo The binding information
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
destroyColumns(): sap.m.TableSelectDialog
Destroys all the columns in the aggregation columns.
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
destroyItems(): sap.m.TableSelectDialog
Destroys all the items in the aggregation items.
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
detachCancel(fnFunction, oListener): sap.m.TableSelectDialog
Detaches event handler fnFunction from the cancel event of this sap.m.TableSelectDialog.

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.m.TableSelectDialog} Reference to this in order to allow method chaining
detachConfirm(fnFunction, oListener): sap.m.TableSelectDialog
Detaches event handler fnFunction from the confirm event of this sap.m.TableSelectDialog.

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.m.TableSelectDialog} Reference to this in order to allow method chaining
detachLiveChange(fnFunction, oListener): sap.m.TableSelectDialog
Detaches event handler fnFunction from the liveChange event of this sap.m.TableSelectDialog.

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.m.TableSelectDialog} Reference to this in order to allow method chaining
detachSearch(fnFunction, oListener): sap.m.TableSelectDialog
Detaches event handler fnFunction from the search event of this sap.m.TableSelectDialog.

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.m.TableSelectDialog} Reference to this in order to allow method chaining
fireCancel(mArguments?): sap.m.TableSelectDialog
Fires event cancel to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
fireConfirm(mArguments?): sap.m.TableSelectDialog
Fires event confirm to attached listeners.

Expects the following event parameters:

  • selectedItem of type sap.m.StandardListItemReturns the selected list 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.
  • selectedItems of type sap.m.StandardListItem[]Returns an array containing the visible selected list items. If no items are selected, an empty array is returned.
  • selectedContexts of type stringReturns the binding contexts of the selected items including the non-visible items. Note: In contrast to the parameter "selectedItems", this parameter includes the selected but NOT visible items (due to list filtering). An empty array is set for this parameter if no Databinding is used.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
fireLiveChange(mArguments?): sap.m.TableSelectDialog
Fires event liveChange to attached listeners.

Expects the following event parameters:

  • value of type stringSpecifies the value entered in the search field.
  • itemsBinding of type anyThe Items binding of the Table Select Dialog. Only available if the items aggregation is bound to a model.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
fireSearch(mArguments?): sap.m.TableSelectDialog
Fires event search to attached listeners.

Expects the following event parameters:

  • value of type stringSpecifies the value entered in the search field.
  • itemsBinding of type anyDetermines the Items binding of the Table Select Dialog. Only available if the items aggregation is bound to a model.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
getColumns(): sap.m.Column[]
Gets content of aggregation columns.

The columns bindings.

Returns:
{sap.m.Column[]}
getContentHeight(): sap.ui.core.CSSSize
Retrieves content height of the select dialog sap.m.Dialog
Returns:
{sap.ui.core.CSSSize} sHeight the content height of the internal dialog
getContentWidth(): sap.ui.core.CSSSize
Retrieves content width of the select dialog sap.m.Dialog
Returns:
{sap.ui.core.CSSSize} sWidth the content width of the internal dialog
getGrowingThreshold(): int
Gets current value of property growingThreshold.

Determines the number of items initially displayed in the table.

Returns:
{int} Value of property growingThreshold
getItems(): sap.m.ColumnListItem[]
Gets content of aggregation items.

The items of the table.

Returns:
{sap.m.ColumnListItem[]}
getMultiSelect(): boolean
Gets current value of property multiSelect.

Enables the user to select several options from the table.

Default value is false.

Returns:
{boolean} Value of property multiSelect
getNoDataText(): string
Retrieves the internal List's no data text property
Returns:
{string} the current no data text
getRememberSelections(): boolean
Gets current value of property rememberSelections.

Controls whether the dialog clears the selection or not. When the dialog is opened multiple times in the same context to allow for corrections of previous user inputs, set this flag to "true". When the dialog should reset the selection to allow for a new selection each time set it to "false" Note: This property must be set before the Dialog is opened to have an effect.

Default value is false.

Since:
1.18
Returns:
{boolean} Value of property rememberSelections
getTitle(): string
Gets current value of property title.

Specifies the title text in the dialog header.

Returns:
{string} Value of property title
indexOfColumn(oColumn): int
Checks for the provided sap.m.Column in the aggregation columns. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.Column}oColumn The column whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
indexOfItem(oItem): int
Checks for the provided sap.m.ColumnListItem in the aggregation items. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.ColumnListItem}oItem The item whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertColumn(oColumn, iIndex): sap.m.TableSelectDialog
Inserts a column into the aggregation columns.
Parameters:
{sap.m.Column}oColumn the column to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the column should be inserted at; for a negative value of iIndex, the column is inserted at position 0; for a value greater than the current size of the aggregation, the column is inserted at the last position
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
insertItem(oItem, iIndex): sap.m.TableSelectDialog
Inserts a item into the aggregation items.
Parameters:
{sap.m.ColumnListItem}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.m.TableSelectDialog} Reference to this in order to allow method chaining
Invalidates the dialog instead of this control, as there is no renderer.
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
onAfterRendering(): sap.m.TableSelectDialog
Shows the busy state and is called after the renderer is finished.
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
open(sSearchValue): sap.m.TableSelectDialog
Opens the internal dialog with a searchfield and a table.
Parameters:
{string}sSearchValue Value for the search. The table will be automatically trigger the search event if this parameter is set.
Returns:
{sap.m.TableSelectDialog}this to allow method chaining
removeAllColumns(): sap.m.Column[]
Removes all the controls from the aggregation columns.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.m.Column[]} An array of the removed elements (might be empty)
removeAllItems(): sap.m.ColumnListItem[]
Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.m.ColumnListItem[]} An array of the removed elements (might be empty)
removeColumn(vColumn): sap.m.Column
Removes a column from the aggregation columns.
Parameters:
{int|string|sap.m.Column}vColumn The columnto remove or its index or id
Returns:
{sap.m.Column} The removed column or null
removeItem(vItem): sap.m.ColumnListItem
Removes a item from the aggregation items.
Parameters:
{int|string|sap.m.ColumnListItem}vItem The itemto remove or its index or id
Returns:
{sap.m.ColumnListItem} The removed item or null
setBusyIndicatorDelay(iValue): sap.m.TableSelectDialog
Sets the busyIndicatorDelay value to the internal table
Parameters:
{int}iValue Value for the busyIndicatorDelay.
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
setContentHeight(sHeight): sap.m.TableSelectDialog
Sets content height of the select dialog sap.m.Dialog
Parameters:
{sap.ui.core.CSSSize}sHeight the new content height value for the dialog
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
setContentWidth(sWidth): sap.m.TableSelectDialog
Sets content width of the select dialog sap.m.Dialog
Parameters:
{sap.ui.core.CSSSize}sWidth the new content width value for the dialog
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
setGrowingThreshold(iValue): sap.m.TableSelectDialog
Sets the growing threshold to the internal table
Parameters:
{int}iValue Value for the table's growing threshold.
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
setMultiSelect(bMulti): sap.m.TableSelectDialog
Enables/Disables multi selection mode.
Parameters:
{boolean}bMulti flag for multi selection mode
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
setNoDataText(sNoDataText)
Sets the no data text of the internal table
Parameters:
{string}sNoDataText the no data text for the table
setRememberSelections(bRememberSelections): sap.m.TableSelectDialog
Sets a new value for property rememberSelections.

Controls whether the dialog clears the selection or not. When the dialog is opened multiple times in the same context to allow for corrections of previous user inputs, set this flag to "true". When the dialog should reset the selection to allow for a new selection each time set it to "false" Note: This property must be set before the Dialog is opened to have an effect.

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

Default value is false.

Parameters:
{boolean}bRememberSelections New value for property rememberSelections
Since:
1.18
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
setTitle(sTitle): sap.m.TableSelectDialog
Sets the title of the internal dialog
Parameters:
{string}sTitle the title text for the dialog
Returns:
{sap.m.TableSelectDialog} this pointer for chaining
unbindColumns(): sap.m.TableSelectDialog
Unbinds aggregation columns from model data.
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining
unbindItems(): sap.m.TableSelectDialog
Unbinds aggregation items from model data.
Returns:
{sap.m.TableSelectDialog} Reference to this in order to allow method chaining