class sap.ui.mdc.filterbar.FilterBarBase

Visiblity: restricted
UX Guidelines:
Implements: sap.ui.mdc.IFiltersap.ui.mdc.IxState
Available since: N/A
Module: sap/ui/mdc/filterbar/FilterBarBase
Application Component: CA-UI5-MDC

The FilterBarBase control is used as a faceless base class for common functionality of any MDC FilterBar derivation.


Constructor

Constructor for a new FilterBarBase.

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.mdc.filterbar.FilterBarBase(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
_filterCount string

Binds the text of the Adapt Filters button.

Visibility: hidden
delegate object ...see text or source

Defines the path to the metadata retrieval class for the FilterBarBase control. It basically identifies the FilterBarDelegate file that provides the required APIs to create the filter bar content.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Note: This property must not be bound.

Since: 1.74.

Visibility: public
filterConditions object empty object

Specifies the filter conditions.
Note: This property must not be bound.
Note: This property is used exclusively for SAPUI5 flexibility. Do not use it otherwise.

Since: 1.66.0.

Visibility: public
liveMode boolean false

Triggers a search automatically after a filter value has been changed.
Note: The liveMode property only operates in non-mobile scenarios.
Additionally, if the liveMode property is active, the following applies:
The error message box is not displayed, and the showMessages property is ignored.

Since: 1.74.

Visibility: public
showGoButton boolean true

Determines whether the Go button is visible in the filter bar.
Note: If the liveMode property is set to true, it is ignored.

Visibility: public
showMessages boolean true

Displays possible errors during the search in a message box.

Since: 1.74.

Visibility: public
suspendSelection boolean false

If set to true, all search requests are ignored. Once it has been set to false, a search is triggered immediately if one or more search requests have been triggered in the meantime but were ignored based on the setting.

Since: 1.79.0.

Visibility: public

Borrowed Properties

Name Type Default Value Description
delegate object

Path to the Delegate module that provides the required APIs to execute model-specific logic.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Do not bind or modify the module. This property can only be configured during control initialization.

Visibility: public

Aggregations

Default Aggregation: filterItems

Name Cardinality Type Description
basicSearchField 0..1 sap.ui.mdc.FilterField

Contains the optional basic search field.

filterItems (default) 0..n sap.ui.mdc.FilterField

Contains all the displayed filter fields of the FilterBarBase control.

layout 0..1 sap.ui.mdc.filterbar.IFilterContainer

Internal hidden aggregation to hold the inner layout.


Associations

Name Cardinality Type Description
variantBackreference 0..1 sap.ui.fl.variants.VariantManagement

VariantManagement control for the filter bar. Note: this association is only required, for being able to get information from SAPUI5 Flexibility whenever a variant was applied, with 'apply automatically' set to true. Note: this association may only be assigned once.


Events Overview

Event Description
filtersChanged

This event is fired after either a filter value or the visibility of a filter item has been changed.

search

This event is fired when the Go button is pressed or after a condition change, when liveMode is active. Note: this event should never be executed programmatically. It is triggered internally by the filter bar after a triggerSearch is executed

filtersChanged

This event is fired after either a filter value or the visibility of a filter item has been changed.

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

search

This event is fired when the Go button is pressed or after a condition change, when liveMode is active. Note: this event should never be executed programmatically. It is triggered internally by the filter bar after a triggerSearch is executed

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

Methods Overview

Method Description
addFilterItem

Adds some filterItem to the aggregation filterItems.

attachFiltersChanged

Attaches event handler fnFunction to the filtersChanged event of this sap.ui.mdc.filterbar.FilterBarBase.

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.mdc.filterbar.FilterBarBase itself.

This event is fired after either a filter value or the visibility of a filter item has been changed.

attachSearch

Attaches event handler fnFunction to the search event of this sap.ui.mdc.filterbar.FilterBarBase.

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.mdc.filterbar.FilterBarBase itself.

This event is fired when the Go button is pressed or after a condition change, when liveMode is active. Note: this event should never be executed programmatically. It is triggered internally by the filter bar after a triggerSearch is executed

destroyBasicSearchField

Destroys the basicSearchField in the aggregation basicSearchField.

destroyFilterItems

Destroys all the filterItems in the aggregation filterItems.

detachFiltersChanged

Detaches event handler fnFunction from the filtersChanged event of this sap.ui.mdc.filterbar.FilterBarBase.

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

detachSearch

Detaches event handler fnFunction from the search event of this sap.ui.mdc.filterbar.FilterBarBase.

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

sap.ui.mdc.filterbar.FilterBarBase.extend

Creates a new subclass of class sap.ui.mdc.filterbar.FilterBarBase 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.mdc.Control.extend.

fireFiltersChanged

Fires event filtersChanged to attached listeners.

fireSearch

Fires event search to attached listeners.

getAssignedFilterNames

Returns the labels of all filters with a value assignment.

Note: filters annotated with hiddenFilters will not be considered

getAssignedFiltersText

Returns a summary string that contains information about the filters currently assigned. The method returns the text summary for the expanded and collapsed states of the filter bar.

Example for collapsed filter bar:
3 filters active: Company Code, Fiscal Year, Customer

Example for expanded filter bar:
3 filters active (1 hidden)

getBasicSearchField

Gets content of aggregation basicSearchField.

Contains the optional basic search field.

getConditions

Returns the external conditions.

getCurrentState

Returns the externalized conditions of the inner condition model. This method may only be called, once the initialzed is resolved. Note: This API may return attributes corresponding to the p13nMode property configuration.

getDelegate

Gets current value of property delegate.

Defines the path to the metadata retrieval class for the FilterBarBase control. It basically identifies the FilterBarDelegate file that provides the required APIs to create the filter bar content.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Note: This property must not be bound.

Default value is ...see text or source.

getFilterConditions

Gets current value of property filterConditions.

Specifies the filter conditions.
Note: This property must not be bound.
Note: This property is used exclusively for SAPUI5 flexibility. Do not use it otherwise.

Default value is {}.

getFilterItems

Gets content of aggregation filterItems.

Contains all the displayed filter fields of the FilterBarBase control.

getIgnoreQueuing

Determines whether the default behavior of the suspendSelection property is overruled.

getInternalConditions

Returns the conditions of the inner condition model.

getLiveMode

Gets current value of property liveMode.

Triggers a search automatically after a filter value has been changed.
Note: The liveMode property only operates in non-mobile scenarios.
Additionally, if the liveMode property is active, the following applies:
The error message box is not displayed, and the showMessages property is ignored.

Default value is false.

sap.ui.mdc.filterbar.FilterBarBase.getMetadata

Returns a metadata object for class sap.ui.mdc.filterbar.FilterBarBase.

getSearch

Returns the value of the basic search condition.

getShowGoButton

Gets current value of property showGoButton.

Determines whether the Go button is visible in the filter bar.
Note: If the liveMode property is set to true, it is ignored.

Default value is true.

getShowMessages

Gets current value of property showMessages.

Displays possible errors during the search in a message box.

Default value is true.

getSuspendSelection

Gets current value of property suspendSelection.

If set to true, all search requests are ignored. Once it has been set to false, a search is triggered immediately if one or more search requests have been triggered in the meantime but were ignored based on the setting.

Default value is false.

getVariantBackreference

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

indexOfFilterItem

Checks for the provided sap.ui.mdc.FilterField in the aggregation filterItems. and returns its index if found or -1 otherwise.

insertFilterItem

Inserts a filterItem into the aggregation filterItems.

removeAllFilterItems

Removes all the controls from the aggregation filterItems.

Additionally, it unregisters them from the hosting UIArea.

removeFilterItem

Removes a filterItem from the aggregation filterItems.

setBasicSearchField

Sets the aggregated basicSearchField.

setDelegate

Sets a new value for property delegate.

Defines the path to the metadata retrieval class for the FilterBarBase control. It basically identifies the FilterBarDelegate file that provides the required APIs to create the filter bar content.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Note: This property must not be bound.

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

Default value is ...see text or source.

setFilterConditions

Sets a new value for property filterConditions.

Specifies the filter conditions.
Note: This property must not be bound.
Note: This property is used exclusively for SAPUI5 flexibility. Do not use it otherwise.

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

Default value is {}.

setIgnoreQueuing

Determines whether the default behavior of the suspendSelection property is overruled. This can only happen during the suspension of the selection. If this property is set to true, a possible queue of search requests is ignored during the final suspendSelection operation. Once the suspension of the selection is over, this value will be set to false.

setInternalConditions

Assigns conditions to the inner condition model.
Note:This method is only called for filling the in parameters for value help scenarios.

setLiveMode

Sets a new value for property liveMode.

Triggers a search automatically after a filter value has been changed.
Note: The liveMode property only operates in non-mobile scenarios.
Additionally, if the liveMode property is active, the following applies:
The error message box is not displayed, and the showMessages property is ignored.

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

Default value is false.

setShowGoButton

Sets a new value for property showGoButton.

Determines whether the Go button is visible in the filter bar.
Note: If the liveMode property is set to true, it is ignored.

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

Default value is true.

setShowMessages

Sets a new value for property showMessages.

Displays possible errors during the search in a message box.

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

Default value is true.

setSuspendSelection

Sets a new value for property suspendSelection.

If set to true, all search requests are ignored. Once it has been set to false, a search is triggered immediately if one or more search requests have been triggered in the meantime but were ignored based on the setting.

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

Default value is false.

setVariantBackreference

Sets the associated variantBackreference.

triggerSearch

Triggers the search.

validate

Returns a promise for the asynchronous validation of filters.

addFilterItem

Adds some filterItem to the aggregation filterItems.

Param Type DefaultValue Description
oFilterItem sap.ui.mdc.FilterField

The filterItem to add; if empty, nothing is inserted

attachFiltersChanged

Attaches event handler fnFunction to the filtersChanged event of this sap.ui.mdc.filterbar.FilterBarBase.

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.mdc.filterbar.FilterBarBase itself.

This event is fired after either a filter value or the visibility of a filter item has been 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.mdc.filterbar.FilterBarBase itself

attachSearch

Attaches event handler fnFunction to the search event of this sap.ui.mdc.filterbar.FilterBarBase.

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.mdc.filterbar.FilterBarBase itself.

This event is fired when the Go button is pressed or after a condition change, when liveMode is active. Note: this event should never be executed programmatically. It is triggered internally by the filter bar after a triggerSearch is executed

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.mdc.filterbar.FilterBarBase itself

destroyBasicSearchField

Destroys the basicSearchField in the aggregation basicSearchField.

destroyFilterItems

Destroys all the filterItems in the aggregation filterItems.

detachFiltersChanged

Detaches event handler fnFunction from the filtersChanged event of this sap.ui.mdc.filterbar.FilterBarBase.

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

detachSearch

Detaches event handler fnFunction from the search event of this sap.ui.mdc.filterbar.FilterBarBase.

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.mdc.filterbar.FilterBarBase.extend

Creates a new subclass of class sap.ui.mdc.filterbar.FilterBarBase 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.mdc.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

fireFiltersChanged

Fires event filtersChanged to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireSearch

Fires event search to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAssignedFilterNames

Returns the labels of all filters with a value assignment.

Note: filters annotated with hiddenFilters will not be considered

getAssignedFiltersText

Returns a summary string that contains information about the filters currently assigned. The method returns the text summary for the expanded and collapsed states of the filter bar.

Example for collapsed filter bar:
3 filters active: Company Code, Fiscal Year, Customer

Example for expanded filter bar:
3 filters active (1 hidden)

getBasicSearchField

Gets content of aggregation basicSearchField.

Contains the optional basic search field.

getConditions

Returns the external conditions.

getCurrentState

Returns the externalized conditions of the inner condition model. This method may only be called, once the initialzed is resolved. Note: This API may return attributes corresponding to the p13nMode property configuration.

getDelegate

Gets current value of property delegate.

Defines the path to the metadata retrieval class for the FilterBarBase control. It basically identifies the FilterBarDelegate file that provides the required APIs to create the filter bar content.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Note: This property must not be bound.

Default value is ...see text or source.

getFilterConditions

Gets current value of property filterConditions.

Specifies the filter conditions.
Note: This property must not be bound.
Note: This property is used exclusively for SAPUI5 flexibility. Do not use it otherwise.

Default value is {}.

getFilterItems

Gets content of aggregation filterItems.

Contains all the displayed filter fields of the FilterBarBase control.

getIgnoreQueuing

Determines whether the default behavior of the suspendSelection property is overruled.

getInternalConditions

Returns the conditions of the inner condition model.

getLiveMode

Gets current value of property liveMode.

Triggers a search automatically after a filter value has been changed.
Note: The liveMode property only operates in non-mobile scenarios.
Additionally, if the liveMode property is active, the following applies:
The error message box is not displayed, and the showMessages property is ignored.

Default value is false.

sap.ui.mdc.filterbar.FilterBarBase.getMetadata

Returns a metadata object for class sap.ui.mdc.filterbar.FilterBarBase.

getSearch

Returns the value of the basic search condition.

getShowGoButton

Gets current value of property showGoButton.

Determines whether the Go button is visible in the filter bar.
Note: If the liveMode property is set to true, it is ignored.

Default value is true.

getShowMessages

Gets current value of property showMessages.

Displays possible errors during the search in a message box.

Default value is true.

getSuspendSelection

Gets current value of property suspendSelection.

If set to true, all search requests are ignored. Once it has been set to false, a search is triggered immediately if one or more search requests have been triggered in the meantime but were ignored based on the setting.

Default value is false.

getVariantBackreference

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

indexOfFilterItem

Checks for the provided sap.ui.mdc.FilterField in the aggregation filterItems. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oFilterItem sap.ui.mdc.FilterField

The filterItem whose index is looked for

insertFilterItem

Inserts a filterItem into the aggregation filterItems.

Param Type DefaultValue Description
oFilterItem sap.ui.mdc.FilterField

The filterItem to insert; if empty, nothing is inserted

iIndex int

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

removeAllFilterItems

Removes all the controls from the aggregation filterItems.

Additionally, it unregisters them from the hosting UIArea.

removeFilterItem

Removes a filterItem from the aggregation filterItems.

Param Type DefaultValue Description
vFilterItem int string sap.ui.mdc.FilterField

The filterItem to remove or its index or id

setBasicSearchField

Sets the aggregated basicSearchField.

Param Type DefaultValue Description
oBasicSearchField sap.ui.mdc.FilterField

The basicSearchField to set

setDelegate

Sets a new value for property delegate.

Defines the path to the metadata retrieval class for the FilterBarBase control. It basically identifies the FilterBarDelegate file that provides the required APIs to create the filter bar content.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Note: This property must not be bound.

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

Default value is ...see text or source.

Param Type DefaultValue Description
oDelegate object ...see text or source

New value for property delegate

setFilterConditions

Sets a new value for property filterConditions.

Specifies the filter conditions.
Note: This property must not be bound.
Note: This property is used exclusively for SAPUI5 flexibility. Do not use it otherwise.

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

Default value is {}.

Param Type DefaultValue Description
oFilterConditions object {}

New value for property filterConditions

setIgnoreQueuing

Determines whether the default behavior of the suspendSelection property is overruled. This can only happen during the suspension of the selection. If this property is set to true, a possible queue of search requests is ignored during the final suspendSelection operation. Once the suspension of the selection is over, this value will be set to false.

Param Type DefaultValue Description
bValue boolean

Indicates if set to true that the default behavior is to be ignored

setInternalConditions

Assigns conditions to the inner condition model.
Note:This method is only called for filling the in parameters for value help scenarios.

Param Type DefaultValue Description
mConditions Object<string,any>

A map containing the conditions

setLiveMode

Sets a new value for property liveMode.

Triggers a search automatically after a filter value has been changed.
Note: The liveMode property only operates in non-mobile scenarios.
Additionally, if the liveMode property is active, the following applies:
The error message box is not displayed, and the showMessages property is ignored.

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

New value for property liveMode

setShowGoButton

Sets a new value for property showGoButton.

Determines whether the Go button is visible in the filter bar.
Note: If the liveMode property is set to true, it is ignored.

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

New value for property showGoButton

setShowMessages

Sets a new value for property showMessages.

Displays possible errors during the search in a message box.

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

New value for property showMessages

setSuspendSelection

Sets a new value for property suspendSelection.

If set to true, all search requests are ignored. Once it has been set to false, a search is triggered immediately if one or more search requests have been triggered in the meantime but were ignored based on the setting.

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

New value for property suspendSelection

setVariantBackreference

Sets the associated variantBackreference.

Param Type DefaultValue Description
oVariantBackreference sap.ui.core.ID sap.ui.fl.variants.VariantManagement

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

triggerSearch

Triggers the search.

validate

Returns a promise for the asynchronous validation of filters.