The FilterBarBase
control is used as a faceless base class for common functionality of any MDC FilterBar derivation.
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 |
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 |
filterConditions | object | empty object | Specifies the filter conditions. |
liveMode | boolean | false | Triggers a search automatically after a filter value has been changed. |
showGoButton | boolean | true | Determines whether the Go button is visible in the filter bar. |
showMessages | boolean | true | Displays possible errors during the search in a message box. |
suspendSelection | boolean | false | If set to |
Name | Type | Default Value | Description |
---|---|---|---|
delegate | object | Path to the |
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 |
layout | 0..1 | sap.ui.mdc.filterbar.IFilterContainer |
Internal hidden aggregation to hold the inner layout. |
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 |
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 |
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 |
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 |
Method | Description |
---|---|
addFilterItem |
Adds some filterItem to the aggregation filterItems. |
attachFiltersChanged |
Attaches event handler When called, the context of the event handler (its This event is fired after either a filter value or the visibility of a filter item has been changed. |
attachSearch |
Attaches event handler When called, the context of the event handler (its This event is fired when the Go button is pressed or after a condition change, when |
destroyBasicSearchField |
Destroys the basicSearchField in the aggregation basicSearchField. |
destroyFilterItems |
Destroys all the filterItems in the aggregation filterItems. |
detachFiltersChanged |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSearch |
Detaches event handler 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
|
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 expanded filter bar: |
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 |
getDelegate |
Gets current value of property delegate. Defines the path to the metadata retrieval class for the Default value is |
getFilterConditions |
Gets current value of property filterConditions. Specifies the filter conditions. Default value is |
getFilterItems |
Gets content of aggregation filterItems. Contains all the displayed filter fields of the |
getIgnoreQueuing |
Determines whether the default behavior of the |
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. Default value is |
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. Default value is |
getShowMessages |
Gets current value of property showMessages. Displays possible errors during the search in a message box. Default value is |
getSuspendSelection |
Gets current value of property suspendSelection. If set to Default value is |
getVariantBackreference |
ID of the element which is the current target of the association variantBackreference, or |
indexOfFilterItem |
Checks for the provided |
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 When called with a value of Default value is |
setFilterConditions |
Sets a new value for property filterConditions. Specifies the filter conditions. When called with a value of Default value is |
setIgnoreQueuing |
Determines whether the default behavior of the |
setInternalConditions |
Assigns conditions to the inner condition model. |
setLiveMode |
Sets a new value for property liveMode. Triggers a search automatically after a filter value has been changed. When called with a value of Default value is |
setShowGoButton |
Sets a new value for property showGoButton. Determines whether the Go button is visible in the filter bar. When called with a value of Default value is |
setShowMessages |
Sets a new value for property showMessages. Displays possible errors during the search in a message box. When called with a value of Default value is |
setSuspendSelection |
Sets a new value for property suspendSelection. If set to When called with a value of Default value is |
setVariantBackreference |
Sets the associated variantBackreference. |
triggerSearch |
Triggers the search. |
validate |
Returns a promise for the asynchronous validation of filters. |
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 |
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 |
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 |
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 |
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 |
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 |
Fires event filtersChanged to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event search to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Returns the labels of all filters with a value assignment.
Note: filters annotated with hiddenFilters will not be considered
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)
Gets content of aggregation basicSearchField.
Contains the optional basic search field.
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.
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
.
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 {}
.
Gets content of aggregation filterItems.
Contains all the displayed filter fields of the FilterBarBase
control.
Determines whether the default behavior of the suspendSelection
property is overruled.
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
.
Returns a metadata object for class sap.ui.mdc.filterbar.FilterBarBase.
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
.
Gets current value of property showMessages.
Displays possible errors during the search in a message box.
Default value is true
.
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
.
ID of the element which is the current target of the association variantBackreference, or null
.
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 |
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 |
Removes all the controls from the aggregation filterItems.
Additionally, it unregisters them from the hosting UIArea.
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 |
Sets the aggregated basicSearchField.
Param | Type | DefaultValue | Description |
---|---|---|---|
oBasicSearchField | sap.ui.mdc.FilterField |
The basicSearchField to set |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |