class sap.ui.ux3.DataSet

Control sample: sap.ui.ux3.DataSet
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/ux3/DataSet
Application Component: CA-UI5-CTR

DataSet


Constructor

Constructor for a new DataSet.

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.ux3.DataSet(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
multiSelect boolean false

Selection mode of the DataSet

Visibility: public
showFilter boolean true

show filter

Visibility: public
showSearchField boolean true

Show/hide SearchField in Toolbar

Visibility: public
showToolbar boolean true

show Toolbar

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
_toolbar 0..1 sap.ui.commons.Toolbar

A Toolbar, internally managed by Dataset

_viewSwitches 0..n sap.ui.core.Control

Internally managed by Dataset

filter 0..n sap.ui.core.Control

Filter control (e.g. a FacetFilter) for the DataSet

items 0..n sap.ui.ux3.DataSetItem

Aggregation of DataSetItems

views 0..n sap.ui.ux3.DataSetView

views


Associations

Name Cardinality Type Description
selectedView 0..1 sap.ui.ux3.DataSetView

Selected view of the Dataset


Events Overview

Event Description
search

Event which is fired when the user triggers a search

selectionChanged

selection Changed

search

Event which is fired when the user triggers a search

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

The search query

selectionChanged

selection Changed

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

Old lead selected index

newLeadSelectedIndex int

New lead selected index


Methods Overview

Method Description
_rerenderFilter

Rerendering of the FilterArea

_rerenderToolbar

Rerendering of the Toolbar

addFilter

Adds some filter to the aggregation filter.

addItem

Adds some item to the aggregation items.

addToolbarItem

add a toolbarItem to the toolbar

addView

Adds some view to the aggregation views.

attachSearch

Attaches event handler fnFunction to the search event of this sap.ui.ux3.DataSet.

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.ux3.DataSet itself.

Event which is fired when the user triggers a search

attachSelectionChanged

Attaches event handler fnFunction to the selectionChanged event of this sap.ui.ux3.DataSet.

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.ux3.DataSet itself.

selection Changed

bindItems

Binds aggregation items to model data.

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

clearSelection

clears dataset from all previous selections

createViewSwitch

Creates a view switch button

destroyFilter

Destroys all the filter in the aggregation filter.

destroyItems

Destroys all the items in the aggregation items.

destroyViews

Destroys all the views in the aggregation views.

detachSearch

Detaches event handler fnFunction from the search event of this sap.ui.ux3.DataSet.

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

detachSelectionChanged

Detaches event handler fnFunction from the selectionChanged event of this sap.ui.ux3.DataSet.

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

sap.ui.ux3.DataSet.extend

Creates a new subclass of class sap.ui.ux3.DataSet 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.

fireSearch

Fires event search to attached listeners.

fireSelectionChanged

Fires event selectionChanged to attached listeners.

getFilter

Gets content of aggregation filter.

Filter control (e.g. a FacetFilter) for the DataSet

getItems

Gets content of aggregation items.

Aggregation of DataSetItems

getLeadSelection

Returns the LeadSelection index

sap.ui.ux3.DataSet.getMetadata

Returns a metadata object for class sap.ui.ux3.DataSet.

getMultiSelect

Gets current value of property multiSelect.

Selection mode of the DataSet

Default value is false.

getSelectedIndex

use this function to retrieve the lead selected index

getSelectedIndices

use this function to retrieve all selected indices if multiple select is enabled

getSelectedItemId

Returns id of selected Item from given index

getSelectedView

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

getShowFilter

Gets current value of property showFilter.

show filter

Default value is true.

getShowSearchField

Gets current value of property showSearchField.

Show/hide SearchField in Toolbar

Default value is true.

getShowToolbar

Gets current value of property showToolbar.

show Toolbar

Default value is true.

getViews

Gets content of aggregation views.

views

indexOfFilter

Checks for the provided sap.ui.core.Control in the aggregation filter. and returns its index if found or -1 otherwise.

indexOfItem

Checks for the provided sap.ui.ux3.DataSetItem in the aggregation items. and returns its index if found or -1 otherwise.

indexOfView

Checks for the provided sap.ui.ux3.DataSetView in the aggregation views. and returns its index if found or -1 otherwise.

insertFilter

Inserts a filter into the aggregation filter.

insertItem

Inserts a item into the aggregation items.

insertView

Inserts a view into the aggregation views.

isSelectedIndex

Returns true if iIndex is selected

removeAllFilter

Removes all the controls from the aggregation filter.

Additionally, it unregisters them from the hosting UIArea.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeAllViews

Removes all the controls from the aggregation views.

Additionally, it unregisters them from the hosting UIArea.

removeFilter

Removes a filter from the aggregation filter.

removeItem

Removes a item from the aggregation items.

removeToolbarItem

remove a toolbarItem to the toolbar

removeView

Removes a view from the aggregation views.

setLeadSelection

Set the LeadSelection index

setMultiSelect

setter for multi selection mode

setSelectedView

Sets the associated selectedView.

setShowFilter

Sets a new value for property showFilter.

show filter

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

Default value is true.

setShowSearchField

Sets a new value for property showSearchField.

Show/hide SearchField in Toolbar

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

Default value is true.

setShowToolbar

Sets a new value for property showToolbar.

show Toolbar

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

Default value is true.

unbindItems

Unbinds aggregation items from model data.

_rerenderFilter

Rerendering of the FilterArea

_rerenderToolbar

Rerendering of the Toolbar

addFilter

Adds some filter to the aggregation filter.

Param Type DefaultValue Description
oFilter sap.ui.core.Control

The filter to add; if empty, nothing is inserted

addItem

Adds some item to the aggregation items.

Param Type DefaultValue Description
oItem sap.ui.ux3.DataSetItem

The item to add; if empty, nothing is inserted

addToolbarItem

add a toolbarItem to the toolbar

Param Type DefaultValue Description
oOToolbarItem sap.ui.commons.ToolbarItem

ToolbarItem

addView

Adds some view to the aggregation views.

Param Type DefaultValue Description
oView sap.ui.ux3.DataSetView

The view to add; if empty, nothing is inserted

attachSearch

Attaches event handler fnFunction to the search event of this sap.ui.ux3.DataSet.

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.ux3.DataSet itself.

Event which is fired when the user triggers a search

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.ux3.DataSet itself

attachSelectionChanged

Attaches event handler fnFunction to the selectionChanged event of this sap.ui.ux3.DataSet.

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.ux3.DataSet itself.

selection Changed

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.ux3.DataSet itself

bindItems

Binds aggregation items to model data.

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

Param Type DefaultValue Description
oBindingInfo sap.ui.base.ManagedObject.AggregationBindingInfo

The binding information

clearSelection

clears dataset from all previous selections

createViewSwitch

Creates a view switch button

Param Type DefaultValue Description
oView object

View

iIndex int

Index of view

destroyFilter

Destroys all the filter in the aggregation filter.

destroyItems

Destroys all the items in the aggregation items.

destroyViews

Destroys all the views in the aggregation views.

detachSearch

Detaches event handler fnFunction from the search event of this sap.ui.ux3.DataSet.

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

detachSelectionChanged

Detaches event handler fnFunction from the selectionChanged event of this sap.ui.ux3.DataSet.

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

sap.ui.ux3.DataSet.extend

Creates a new subclass of class sap.ui.ux3.DataSet 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.

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

fireSearch

Fires event search to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

query string

The search query

fireSelectionChanged

Fires event selectionChanged to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

oldLeadSelectedIndex int

Old lead selected index

newLeadSelectedIndex int

New lead selected index

getFilter

Gets content of aggregation filter.

Filter control (e.g. a FacetFilter) for the DataSet

getItems

Gets content of aggregation items.

Aggregation of DataSetItems

getLeadSelection

Returns the LeadSelection index

sap.ui.ux3.DataSet.getMetadata

Returns a metadata object for class sap.ui.ux3.DataSet.

getMultiSelect

Gets current value of property multiSelect.

Selection mode of the DataSet

Default value is false.

getSelectedIndex

use this function to retrieve the lead selected index

getSelectedIndices

use this function to retrieve all selected indices if multiple select is enabled

getSelectedItemId

Returns id of selected Item from given index

Param Type DefaultValue Description
iIndex int

index of selection

getSelectedView

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

getShowFilter

Gets current value of property showFilter.

show filter

Default value is true.

getShowSearchField

Gets current value of property showSearchField.

Show/hide SearchField in Toolbar

Default value is true.

getShowToolbar

Gets current value of property showToolbar.

show Toolbar

Default value is true.

getViews

Gets content of aggregation views.

views

indexOfFilter

Checks for the provided sap.ui.core.Control in the aggregation filter. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oFilter sap.ui.core.Control

The filter whose index is looked for

indexOfItem

Checks for the provided sap.ui.ux3.DataSetItem in the aggregation items. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oItem sap.ui.ux3.DataSetItem

The item whose index is looked for

indexOfView

Checks for the provided sap.ui.ux3.DataSetView in the aggregation views. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oView sap.ui.ux3.DataSetView

The view whose index is looked for

insertFilter

Inserts a filter into the aggregation filter.

Param Type DefaultValue Description
oFilter sap.ui.core.Control

The filter to insert; if empty, nothing is inserted

iIndex int

The 0-based index the filter should be inserted at; for a negative value of iIndex, the filter is inserted at position 0; for a value greater than the current size of the aggregation, the filter is inserted at the last position

insertItem

Inserts a item into the aggregation items.

Param Type DefaultValue Description
oItem sap.ui.ux3.DataSetItem

The item to insert; if empty, nothing is inserted

iIndex int

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

insertView

Inserts a view into the aggregation views.

Param Type DefaultValue Description
oView sap.ui.ux3.DataSetView

The view to insert; if empty, nothing is inserted

iIndex int

The 0-based index the view should be inserted at; for a negative value of iIndex, the view is inserted at position 0; for a value greater than the current size of the aggregation, the view is inserted at the last position

isSelectedIndex

Returns true if iIndex is selected

Param Type DefaultValue Description
iIndex int

index of selection

removeAllFilter

Removes all the controls from the aggregation filter.

Additionally, it unregisters them from the hosting UIArea.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeAllViews

Removes all the controls from the aggregation views.

Additionally, it unregisters them from the hosting UIArea.

removeFilter

Removes a filter from the aggregation filter.

Param Type DefaultValue Description
vFilter int string sap.ui.core.Control

The filter to remove or its index or id

removeItem

Removes a item from the aggregation items.

Param Type DefaultValue Description
vItem int string sap.ui.ux3.DataSetItem

The item to remove or its index or id

removeToolbarItem

remove a toolbarItem to the toolbar

Param Type DefaultValue Description
oOToolbarItem sap.ui.commons.ToolbarItem

removeView

Removes a view from the aggregation views.

Param Type DefaultValue Description
vView int string sap.ui.ux3.DataSetView

The view to remove or its index or id

setLeadSelection

Set the LeadSelection index

Param Type DefaultValue Description
iIIndex int

set LeadSelection index

setMultiSelect

setter for multi selection mode

Param Type DefaultValue Description
bMode boolean

true for multi mode, false for single mode

setSelectedView

Sets the associated selectedView.

Param Type DefaultValue Description
oSelectedView sap.ui.core.ID sap.ui.ux3.DataSetView

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

setShowFilter

Sets a new value for property showFilter.

show filter

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

New value for property showFilter

setShowSearchField

Sets a new value for property showSearchField.

Show/hide SearchField in Toolbar

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

New value for property showSearchField

setShowToolbar

Sets a new value for property showToolbar.

show Toolbar

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

New value for property showToolbar

unbindItems

Unbinds aggregation items from model data.