A smart control to simplify using the sap.m.List
and sap.m.Tree
controls in list patterns.
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.
The SmartList
control consists of the following elements:
OverflowToolbar
control: Displays the header and other action buttons. Users can add their own toolbar and buttons in the view.List
or Tree
control: The actual list/tree control. Users can also add this in the view with the required configuration.entitySet
property must be specified to use the control. This attribute is used to fetch the actual data.listItemTemplate
aggregation must also be specified with the required item template, such as StandardListItem/StandardTreeItem
, which will be used during binding. Most of the attributes/properties are not dynamic and cannot be changed once the control has been initialized.
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 |
Name | Type | Default Value | Description |
---|---|---|---|
enableAutoBinding | boolean | false | When set to |
entitySet | string | The entity set name from which to fetch data. |
|
expandFields | string | CSV of fields that must be expanded when request is sent to the backend. |
|
header | string | Specifies header text that is shown in list. |
|
listBindingPath | string | Specifies the path that is used during the binding of the list. If not specified, the |
|
listType | sap.ui.comp.smartlist.ListType | Specifies the type of list to be created in the |
|
selectFields | string | CSV of fields that must be selected when request is sent to the backend. |
|
showFullScreenButton | boolean | false | Controls the visibility of the full screen button. |
showRowCount | boolean | true | The number of rows is shown along with the header text if the property Note:
Since: 1.48.0.Visibility: public |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
listItemTemplate | 0..1 | sap.m.ListItemBase |
Specifies the template that is used for the inner |
Name | Cardinality | Type | Description |
---|---|---|---|
smartFilter | 0..1 | sap.ui.core.Control |
The |
Event | Description |
---|---|
beforeRebindList |
Event fired right before the binding is being done. |
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 |
initialise |
Event fired once the control has been initialized. |
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 |
Method | Description |
---|---|
attachBeforeRebindList |
Attaches event handler When called, the context of the event handler (its Event fired right before the binding is being done. |
attachDataReceived |
Attaches event handler When called, the context of the event handler (its Event fired when data is received after binding. The event is usually only fired if the binding for the list is done by the |
attachInitialise |
Attaches event handler When called, the context of the event handler (its Event fired once the control has been initialized. |
destroyListItemTemplate |
Destroys the listItemTemplate in the aggregation listItemTemplate. |
detachBeforeRebindList |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDataReceived |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachInitialise |
Detaches event handler 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
|
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 Default value is |
getEntitySet |
Gets current value of property entitySet. The entity set name from which to fetch data. |
getExpandFields |
Gets current value of property expandFields. CSV of fields that must be expanded when request is sent to the backend. |
getHeader |
Gets current value of property header. Specifies header text that is shown in list. |
getList |
Returns the |
getListBindingPath |
Gets current value of property listBindingPath. Specifies the path that is used during the binding of the list. If not specified, the |
getListItemTemplate |
Gets content of aggregation listItemTemplate. Specifies the template that is used for the inner |
getListType |
Gets current value of property listType. Specifies the type of list to be created in the |
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. |
getShowFullScreenButton |
Gets current value of property showFullScreenButton. Controls the visibility of the full screen button. Default value is |
getShowRowCount |
Gets current value of property showRowCount. The number of rows is shown along with the header text if the property Note:
Default value is |
getSmartFilter |
ID of the element which is the current target of the association smartFilter, or |
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 When called with a value of Default value is |
setEntitySet |
Sets a new value for property entitySet. The entity set name from which to fetch data. When called with a value of |
setExpandFields |
Sets a new value for property expandFields. CSV of fields that must be expanded when request is sent to the backend. When called with a value of |
setHeader |
Sets a new value for property header. Specifies header text that is shown in list. When called with a value of |
setListBindingPath |
Sets a new value for property listBindingPath. Specifies the path that is used during the binding of the list. If not specified, the When called with a value of |
setListItemTemplate |
Sets the aggregated listItemTemplate. |
setListType |
Sets a new value for property listType. Specifies the type of list to be created in the When called with a value of |
setSelectFields |
Sets a new value for property selectFields. CSV of fields that must be selected when request is sent to the backend. When called with a value of |
setShowFullScreenButton |
Sets a new value for property showFullScreenButton. Controls the visibility of the full screen button. When called with a value of Default value is |
setShowRowCount |
Sets a new value for property showRowCount. The number of rows is shown along with the header text if the property Note:
When called with a value of Default value is |
setSmartFilter |
Sets the associated smartFilter. |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Fires event beforeRebindList to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event dataReceived to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event initialise to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
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
.
Gets current value of property entitySet.
The entity set name from which to fetch data.
Note:
This is not a dynamic UI5 property.
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
.
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
)
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.
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.
Returns a metadata object for class sap.ui.comp.smartlist.SmartList.
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
.
Gets current value of property showFullScreenButton.
Controls the visibility of the full screen button.
Default value is false
.
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
.
ID of the element which is the current target of the association smartFilter, or null
.
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 |
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 |
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 |
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 |
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 |
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 |
Sets the aggregated listItemTemplate.
Param | Type | DefaultValue | Description |
---|---|---|---|
oListItemTemplate | sap.m.ListItemBase |
The listItemTemplate to set |
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 |
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 |
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 |
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 |
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 |