class sap.ui.comp.smartlist.SmartList

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Extends: sap.m.VBox
Module: sap/ui/comp/smartlist/SmartList
Application Component: CA-UI5-TBL

A smart control to simplify using the sap.m.List and sap.m.Tree controls in list patterns.

Overview

The SmartList control creates a list or tree based on the configuration specified. There is, however, a difference to other smart controls: This control does not use annotations to automatically create its content. Hence, a template must always be provided for this control.

Structure

The SmartList control consists of the following elements:

The entitySet property must be specified to use the control. This attribute is used to fetch the actual data.
The listItemTemplate aggregation must also be specified with the required item template, such as StandardListItem/StandardTreeItem, which will be used during binding.

Note:

Most of the attributes/properties are not dynamic and cannot be changed once the control has been initialized.


Constructor

Constructor for a new smartlist/SmartList.

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.ui.comp.smartlist.SmartList(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


Properties

Name Type Default Value Description
enableAutoBinding boolean false

When set to true, this enables automatic binding of the list using the listBindingPath (if it exists) or entitySet property. This happens right after the initialise event has been fired.

Since: 1.48.0.

Visibility: public
entitySet string

The entity set name from which to fetch data.
Note:
This is not a dynamic UI5 property.

Since: 1.48.0.

Visibility: public
expandFields string

CSV of fields that must be expanded when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

Since: 1.48.0.

Visibility: public
header string

Specifies header text that is shown in list.

Since: 1.48.0.

Visibility: public
listBindingPath string

Specifies the path that is used during the binding of the list. If not specified, the entitySet property is used instead. (used only if binding is done automatically or when using rebindList)

Since: 1.48.0.

Visibility: public
listType sap.ui.comp.smartlist.ListType

Specifies the type of list to be created in the SmartList control.
Note:
If you add a List or Tree to the content of the SmartList control in the view, this property has no effect.

Since: 1.48.0.

Visibility: public
selectFields string

CSV of fields that must be selected when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

Since: 1.48.0.

Visibility: public
showFullScreenButton boolean false

Controls the visibility of the full screen button.

Since: 1.48.0.

Visibility: public
showRowCount boolean true

The number of rows is shown along with the header text if the property showRowCount is set to true.

Note:

  • To improve your application's performance, activate the inline count for OData bindings to avoid sending dedicated OData requests.
  • If no stable overall count can be retrieved from the binding, the count will not be displayed. This is currently the case for TreeBinding or if no count is requested by the binding.


Since: 1.48.0.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
listItemTemplate 0..1 sap.m.ListItemBase

Specifies the template that is used for the inner List or Tree control.
Note:
This template is used when binding the items of sap.m.List or sap.m.Tree control, and will not be available in the SmartList control once the binding has been done.

Since: 1.48.0.


Associations

Name Cardinality Type Description
smartFilter 0..1 sap.ui.core.Control

The SmartFilterBar control to be linked to the SmartList control. Some events of the SmartFilterBar control are then used to fetch data, show overlay etc.

Since: 1.48.0.


Events Overview

Event Description
beforeRebindList

Event fired right before the binding is being done.

Since: 1.48.0.

dataReceived

Event fired when data is received after binding. The event is usually only fired if the binding for the list is done by the SmartList control itself.

Since: 1.48.0.

initialise

Event fired once the control has been initialized.

Since: 1.48.0.

beforeRebindList

Event fired right before the binding is being done.

Since: 1.48.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

dataReceived

Event fired when data is received after binding. The event is usually only fired if the binding for the list is done by the SmartList control itself.

Since: 1.48.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

initialise

Event fired once the control has been initialized.

Since: 1.48.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
attachBeforeRebindList

Attaches event handler fnFunction to the beforeRebindList event of this sap.ui.comp.smartlist.SmartList.

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.comp.smartlist.SmartList itself.

Event fired right before the binding is being done.

attachDataReceived

Attaches event handler fnFunction to the dataReceived event of this sap.ui.comp.smartlist.SmartList.

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.comp.smartlist.SmartList itself.

Event fired when data is received after binding. The event is usually only fired if the binding for the list is done by the SmartList control itself.

attachInitialise

Attaches event handler fnFunction to the initialise event of this sap.ui.comp.smartlist.SmartList.

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.comp.smartlist.SmartList itself.

Event fired once the control has been initialized.

destroyListItemTemplate

Destroys the listItemTemplate in the aggregation listItemTemplate.

detachBeforeRebindList

Detaches event handler fnFunction from the beforeRebindList event of this sap.ui.comp.smartlist.SmartList.

The passed function and listener object must match the ones used for event registration.

detachDataReceived

Detaches event handler fnFunction from the dataReceived event of this sap.ui.comp.smartlist.SmartList.

The passed function and listener object must match the ones used for event registration.

detachInitialise

Detaches event handler fnFunction from the initialise event of this sap.ui.comp.smartlist.SmartList.

The passed function and listener object must match the ones used for event registration.

exit

Cleans up the control

sap.ui.comp.smartlist.SmartList.extend

Creates a new subclass of class sap.ui.comp.smartlist.SmartList 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.VBox.extend.

fireBeforeRebindList

Fires event beforeRebindList to attached listeners.

fireDataReceived

Fires event dataReceived to attached listeners.

fireInitialise

Fires event initialise to attached listeners.

getEnableAutoBinding

Gets current value of property enableAutoBinding.

When set to true, this enables automatic binding of the list using the listBindingPath (if it exists) or entitySet property. This happens right after the initialise event has been fired.

Default value is false.

getEntitySet

Gets current value of property entitySet.

The entity set name from which to fetch data.
Note:
This is not a dynamic UI5 property.

getExpandFields

Gets current value of property expandFields.

CSV of fields that must be expanded when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

getHeader

Gets current value of property header.

Specifies header text that is shown in list.

getList

Returns the List or Tree used internally.

getListBindingPath

Gets current value of property listBindingPath.

Specifies the path that is used during the binding of the list. If not specified, the entitySet property is used instead. (used only if binding is done automatically or when using rebindList)

getListItemTemplate

Gets content of aggregation listItemTemplate.

Specifies the template that is used for the inner List or Tree control.
Note:
This template is used when binding the items of sap.m.List or sap.m.Tree control, and will not be available in the SmartList control once the binding has been done.

getListType

Gets current value of property listType.

Specifies the type of list to be created in the SmartList control.
Note:
If you add a List or Tree to the content of the SmartList control in the view, this property has no effect.

sap.ui.comp.smartlist.SmartList.getMetadata

Returns a metadata object for class sap.ui.comp.smartlist.SmartList.

getSelectFields

Gets current value of property selectFields.

CSV of fields that must be selected when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

getShowFullScreenButton

Gets current value of property showFullScreenButton.

Controls the visibility of the full screen button.

Default value is false.

getShowRowCount

Gets current value of property showRowCount.

The number of rows is shown along with the header text if the property showRowCount is set to true.

Note:

  • To improve your application's performance, activate the inline count for OData bindings to avoid sending dedicated OData requests.
  • If no stable overall count can be retrieved from the binding, the count will not be displayed. This is currently the case for TreeBinding or if no count is requested by the binding.

Default value is true.

getSmartFilter

ID of the element which is the current target of the association smartFilter, or null.

isInitialised

Checks whether the control is initialized.

rebindList

This can be used to trigger binding on the list used in the SmartList

setEnableAutoBinding

Sets a new value for property enableAutoBinding.

When set to true, this enables automatic binding of the list using the listBindingPath (if it exists) or entitySet property. This happens right after the initialise event has been fired.

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

Default value is false.

setEntitySet

Sets a new value for property entitySet.

The entity set name from which to fetch data.
Note:
This is not a dynamic UI5 property.

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

setExpandFields

Sets a new value for property expandFields.

CSV of fields that must be expanded when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

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

setHeader

Sets a new value for property header.

Specifies header text that is shown in list.

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

setListBindingPath

Sets a new value for property listBindingPath.

Specifies the path that is used during the binding of the list. If not specified, the entitySet property is used instead. (used only if binding is done automatically or when using rebindList)

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

setListItemTemplate

Sets the aggregated listItemTemplate.

setListType

Sets a new value for property listType.

Specifies the type of list to be created in the SmartList control.
Note:
If you add a List or Tree to the content of the SmartList control in the view, this property has no effect.

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

setSelectFields

Sets a new value for property selectFields.

CSV of fields that must be selected when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

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

setShowFullScreenButton

Sets a new value for property showFullScreenButton.

Controls the visibility of the full screen button.

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

Default value is false.

setShowRowCount

Sets a new value for property showRowCount.

The number of rows is shown along with the header text if the property showRowCount is set to true.

Note:

  • To improve your application's performance, activate the inline count for OData bindings to avoid sending dedicated OData requests.
  • If no stable overall count can be retrieved from the binding, the count will not be displayed. This is currently the case for TreeBinding or if no count is requested by the binding.

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

Default value is true.

setSmartFilter

Sets the associated smartFilter.

attachBeforeRebindList

Attaches event handler fnFunction to the beforeRebindList event of this sap.ui.comp.smartlist.SmartList.

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.comp.smartlist.SmartList itself.

Event fired right before the binding is being done.

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 sap.ui.comp.smartlist.SmartList itself

attachDataReceived

Attaches event handler fnFunction to the dataReceived event of this sap.ui.comp.smartlist.SmartList.

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.comp.smartlist.SmartList itself.

Event fired when data is received after binding. The event is usually only fired if the binding for the list is done by the SmartList control itself.

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 sap.ui.comp.smartlist.SmartList itself

attachInitialise

Attaches event handler fnFunction to the initialise event of this sap.ui.comp.smartlist.SmartList.

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.comp.smartlist.SmartList itself.

Event fired once the control has been initialized.

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 sap.ui.comp.smartlist.SmartList itself

destroyListItemTemplate

Destroys the listItemTemplate in the aggregation listItemTemplate.

detachBeforeRebindList

Detaches event handler fnFunction from the beforeRebindList event of this sap.ui.comp.smartlist.SmartList.

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

detachDataReceived

Detaches event handler fnFunction from the dataReceived event of this sap.ui.comp.smartlist.SmartList.

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

detachInitialise

Detaches event handler fnFunction from the initialise event of this sap.ui.comp.smartlist.SmartList.

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

exit

Cleans up the control

sap.ui.comp.smartlist.SmartList.extend

Creates a new subclass of class sap.ui.comp.smartlist.SmartList 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.VBox.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

fireBeforeRebindList

Fires event beforeRebindList to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireDataReceived

Fires event dataReceived to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireInitialise

Fires event initialise to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getEnableAutoBinding

Gets current value of property enableAutoBinding.

When set to true, this enables automatic binding of the list using the listBindingPath (if it exists) or entitySet property. This happens right after the initialise event has been fired.

Default value is false.

getEntitySet

Gets current value of property entitySet.

The entity set name from which to fetch data.
Note:
This is not a dynamic UI5 property.

getExpandFields

Gets current value of property expandFields.

CSV of fields that must be expanded when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

getHeader

Gets current value of property header.

Specifies header text that is shown in list.

getList

Returns the List or Tree used internally.

getListBindingPath

Gets current value of property listBindingPath.

Specifies the path that is used during the binding of the list. If not specified, the entitySet property is used instead. (used only if binding is done automatically or when using rebindList)

getListItemTemplate

Gets content of aggregation listItemTemplate.

Specifies the template that is used for the inner List or Tree control.
Note:
This template is used when binding the items of sap.m.List or sap.m.Tree control, and will not be available in the SmartList control once the binding has been done.

getListType

Gets current value of property listType.

Specifies the type of list to be created in the SmartList control.
Note:
If you add a List or Tree to the content of the SmartList control in the view, this property has no effect.

sap.ui.comp.smartlist.SmartList.getMetadata

Returns a metadata object for class sap.ui.comp.smartlist.SmartList.

getSelectFields

Gets current value of property selectFields.

CSV of fields that must be selected when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

getShowFullScreenButton

Gets current value of property showFullScreenButton.

Controls the visibility of the full screen button.

Default value is false.

getShowRowCount

Gets current value of property showRowCount.

The number of rows is shown along with the header text if the property showRowCount is set to true.

Note:

Default value is true.

getSmartFilter

ID of the element which is the current target of the association smartFilter, or null.

isInitialised

Checks whether the control is initialized.

rebindList

This can be used to trigger binding on the list used in the SmartList

Param Type DefaultValue Description
bForceRebind boolean

force bind call to be triggered on the inner list

setEnableAutoBinding

Sets a new value for property enableAutoBinding.

When set to true, this enables automatic binding of the list using the listBindingPath (if it exists) or entitySet property. This happens right after the initialise event has been fired.

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
bEnableAutoBinding boolean false

New value for property enableAutoBinding

setEntitySet

Sets a new value for property entitySet.

The entity set name from which to fetch data.
Note:
This is not a dynamic UI5 property.

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

Param Type DefaultValue Description
sEntitySet string

New value for property entitySet

setExpandFields

Sets a new value for property expandFields.

CSV of fields that must be expanded when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

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

Param Type DefaultValue Description
sExpandFields string

New value for property expandFields

setHeader

Sets a new value for property header.

Specifies header text that is shown in list.

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

Param Type DefaultValue Description
sHeader string

New value for property header

setListBindingPath

Sets a new value for property listBindingPath.

Specifies the path that is used during the binding of the list. If not specified, the entitySet property is used instead. (used only if binding is done automatically or when using rebindList)

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

Param Type DefaultValue Description
sListBindingPath string

New value for property listBindingPath

setListItemTemplate

Sets the aggregated listItemTemplate.

Param Type DefaultValue Description
oListItemTemplate sap.m.ListItemBase

The listItemTemplate to set

setListType

Sets a new value for property listType.

Specifies the type of list to be created in the SmartList control.
Note:
If you add a List or Tree to the content of the SmartList control in the view, this property has no effect.

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

Param Type DefaultValue Description
sListType sap.ui.comp.smartlist.ListType

New value for property listType

setSelectFields

Sets a new value for property selectFields.

CSV of fields that must be selected when request is sent to the backend.
Note:
No validation is done. Please ensure that you do not add spaces or special characters.
This property is only needed when used together with an ODataModel.

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

Param Type DefaultValue Description
sSelectFields string

New value for property selectFields

setShowFullScreenButton

Sets a new value for property showFullScreenButton.

Controls the visibility of the full screen button.

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
bShowFullScreenButton boolean false

New value for property showFullScreenButton

setShowRowCount

Sets a new value for property showRowCount.

The number of rows is shown along with the header text if the property showRowCount is set to true.

Note:

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
bShowRowCount boolean true

New value for property showRowCount

setSmartFilter

Sets the associated smartFilter.

Param Type DefaultValue Description
oSmartFilter sap.ui.core.ID sap.ui.core.Control

ID of an element which becomes the new target of this smartFilter association; alternatively, an element instance may be given