Class sap.ui.comp.smartfilterbar.SmartFilterBarModule: sap/ui/comp/smartfilterbar/SmartFilterBar

extends FilterBar

The SmartFilterBar control uses the OData metadata of an entity in order to create a filter bar.
Whether a field is visible on the filter bar, supports type-ahead and value help, for example, is automatically determined. When you use control configurations and group configurations it is possible to configure the filter bar and adapt it according to your needs.
Note:
Most of the attributes/properties are not dynamic and cannot be changed once the control has been initialized.

A detailed description of the OData annotations handled by this control is available here.
Annotation Limitations: Qualifier support for entity types is limited for this control.

Constructor Summary
new sap.ui.comp.smartfilterbar.SmartFilterBar(sId?, mSettings?)Constructor for a new smartfilterbar/SmartFilterBar.
Event Summary
pendingChange(oControlEvent)This event is fired after the pending state of the FilterBar control changes.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.comp.smartfilterbar.SmartFilterBar.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.comp.smartfilterbar.SmartFilterBar with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.comp.smartfilterbar.SmartFilterBar.getMetadata()Returns a metadata object for class sap.ui.comp.smartfilterbar.SmartFilterBar.
addControlConfiguration(oControlConfiguration)Adds some controlConfiguration to the aggregation controlConfiguration.
addFieldToAdvancedArea(sKey)Searches for the filter field having the specified OData key and adds this filter field to the advanced area.
addGroupConfiguration(oGroupConfiguration)Adds some groupConfiguration to the aggregation groupConfiguration.
applyVariant(oVariant)Applies the current variant as opposed to fetchVariant.
attachPendingChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the pendingChange event of this sap.ui.comp.smartfilterbar.SmartFilterBar.
destroy()Destroys the control.
destroyControlConfiguration()Destroys all the controlConfiguration in the aggregation controlConfiguration.
destroyGroupConfiguration()Destroys all the groupConfiguration in the aggregation groupConfiguration.
detachPendingChange(fnFunction, oListener)Detaches event handler fnFunction from the pendingChange event of this sap.ui.comp.smartfilterbar.SmartFilterBar.
fetchVariant()Retrieves the currently visible filters and the values for storing them as variants.
firePendingChange(mArguments?)Fires event pendingChange to attached listeners.
getBasicSearchControl()Returns an instance of the control for the basic search.
getBasicSearchFieldName()Gets current value of property basicSearchFieldName.
getControlByKey(sKey)Returns the control (if any) with the specified key (Property name in OData entity).
getControlConfiguration()Gets content of aggregation controlConfiguration.
getEnableBasicSearch()Gets current value of property enableBasicSearch.
getEntityType()Gets current value of property entityType.
getFilterData(bAllFilterData)Returns the data currently set in the filter data model.
getFilterDataAsString(bAllFilterData)Returns the data currently set in the filter data model as string.
getFilters(aFieldNames?)Returns an array of filters (sap.ui.model.Filter instances), for visible fields, that can be used to restrict the query result from OData.
getGroupConfiguration()Gets content of aggregation groupConfiguration.
getParameters()Returns a parameter object that can be used to restrict the query result from OData in case of basic search.
getSmartVariant()ID of the element which is the current target of the association smartVariant, or null.
indexOfControlConfiguration(oControlConfiguration)Checks for the provided sap.ui.comp.smartfilterbar.ControlConfiguration in the aggregation controlConfiguration.
indexOfGroupConfiguration(oGroupConfiguration)Checks for the provided sap.ui.comp.smartfilterbar.GroupConfiguration in the aggregation groupConfiguration.
insertControlConfiguration(oControlConfiguration, iIndex)Inserts a controlConfiguration into the aggregation controlConfiguration.
insertGroupConfiguration(oGroupConfiguration, iIndex)Inserts a groupConfiguration into the aggregation groupConfiguration.
isPending()Checks the pending state of the FilterBar control
removeAllControlConfiguration()Removes all the controls from the aggregation controlConfiguration.
removeAllGroupConfiguration()Removes all the controls from the aggregation groupConfiguration.
removeControlConfiguration(vControlConfiguration)Removes a controlConfiguration from the aggregation controlConfiguration.
removeGroupConfiguration(vGroupConfiguration)Removes a groupConfiguration from the aggregation groupConfiguration.
setBasicSearchFieldName(sBasicSearchFieldName)Sets a new value for property basicSearchFieldName.
setEnableBasicSearch(bEnableBasicSearch)Sets a new value for property enableBasicSearch.
setEntityType(sEntityTypeName)The entity type name from OData metadata, for which the filter bar is created.
setFilterData(oJson, bReplace)Sets the data in the filter data model.
setFilterDataAsString(sJson, bReplace)Sets the data in the filter data model as string.
setSmartVariant(oSmartVariant)Sets the associated smartVariant.
getResourceUri()Gets current value of property resourceUri.
setResourceUri(sResourceUri)Uses the provided resource URI to fetch the OData metadata instead of using the default ODataModel (getModel()).
Methods borrowed from class sap.ui.comp.filterbar.FilterBar
addFilterGroupItem, addFilterItem, attachAfterVariantLoad, attachAfterVariantSave, attachAssignedFiltersChanged, attachBeforeVariantFetch, attachBeforeVariantSave, attachCancel, attachClear, attachFilterChange, attachFiltersDialogClosed, attachInitialise, attachInitialized, attachReset, attachSearch, clearVariantSelection, destroyFilterGroupItems, destroyFilterItems, detachAfterVariantLoad, detachAfterVariantSave, detachAssignedFiltersChanged, detachBeforeVariantFetch, detachBeforeVariantSave, detachCancel, detachClear, detachFilterChange, detachFiltersDialogClosed, detachInitialise, detachInitialized, detachReset, detachSearch, determineControlByFilterItem, determineControlByName, determineMandatoryFilterItems, fireAfterVariantSave, fireAssignedFiltersChanged, fireBeforeVariantFetch, fireCancel, fireFiltersDialogClosed, fireInitialise, fireInitialized, fireSearch, getAdvancedMode, getAllFilterItems, getBasicSearch, getConsiderGroupTitle, getCurrentVariantId, getDataSuiteFormat, getDeltaVariantMode, getFilterBarExpanded, getFilterContainerWidth, getFilterGroupItems, getFilterItems, getHeader, getPersistencyKey, getSearchEnabled, getShowClearButton, getShowClearOnFB, getShowFilterConfiguration, getShowGoOnFB, getShowRestoreButton, getShowRestoreOnFB, getUseToolbar, indexOfFilterGroupItem, indexOfFilterItem, insertFilterGroupItem, insertFilterItem, registerApplyData, registerFetchData, registerGetFiltersWithValues, removeAllFilterGroupItems, removeAllFilterItems, removeAllFilters, removeBasicSearch, removeFilterGroupItem, removeFilterItem, retrieveFiltersWithValues, retrieveFiltersWithValuesAsText, setAdvancedMode, setBasicSearch, setConsiderGroupTitle, setCurrentVariantId, setDataSuiteFormat, setDeltaVariantMode, setFilterBarExpanded, setFilterContainerWidth, setHeader, setPersistencyKey, setShowClearButton, setShowClearOnFB, setShowGoOnFB, setShowRestoreButton, setShowRestoreOnFB, setUseToolbar
OData Annotation Summary
FilterRestrictions/NonFilterableProperties(Org.OData.Capabilities.V1) on EntitySetDefines whether a Property can be used for filtering data.
FieldGroup(com.sap.vocabularies.UI.v1) on EntityTypeDefines a group for a filter field.
TextArrangement(com.sap.vocabularies.UI.v1) on EntityTypeDescribes the arrangement of a code value and its text.
FieldControlType/Hidden(com.sap.vocabularies.Common.v1) on PropertyDefines whether the filter is visible.
ValueList(com.sap.vocabularies.Common.v1) on Property,ParameterContains annotations that provide information for rendering a ValueHelpList that are set on the Property.
Label(com.sap.vocabularies.Common.v1) on Property,PropertyPathA short, human-readable text suitable for the filter's name.
LineItem/Label(com.sap.vocabularies.UI.v1) on Property,ParameterA short, human-readable text suitable for the filter's name.
FilterRestrictions/RequiredProperties(Org.OData.Capabilities.V1) on EntitySetDefines the filter field as mandatory filter.
FilterExpressionRestrictions/MultiValue(com.sap.vocabularies.Common.v1) on EntitySetDefines whether multiple values can be used in a single filter.
FilterExpressionRestrictions/SingleValue(com.sap.vocabularies.Common.v1) on EntitySetRestricts the filter to only one single value entry.
FilterExpressionRestrictions/SingleInterval(com.sap.vocabularies.Common.v1) on EntitySetRestricts the filter to specify an interval, for example, a date interval for filtering the data present between the given dates.
Constructor Detail
new sap.ui.comp.smartfilterbar.SmartFilterBar(sId?, mSettings?)
Constructor for a new smartfilterbar/SmartFilterBar.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

In addition, all settings applicable to the base type sap.ui.comp.filterbar.FilterBar can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Event Detail
pendingChange(oControlEvent)
This event is fired after the pending state of the FilterBar control changes.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Since:
1.36
Method Detail
sap.ui.comp.smartfilterbar.SmartFilterBar.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.comp.smartfilterbar.SmartFilterBar 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.comp.filterbar.FilterBar.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.comp.smartfilterbar.SmartFilterBar.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.comp.smartfilterbar.SmartFilterBar.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addControlConfiguration(oControlConfiguration): sap.ui.comp.smartfilterbar.SmartFilterBar
Adds some controlConfiguration to the aggregation controlConfiguration.
Parameters:
{sap.ui.comp.smartfilterbar.ControlConfiguration}oControlConfiguration the controlConfiguration to add; if empty, nothing is inserted
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
addFieldToAdvancedArea(sKey)
Searches for the filter field having the specified OData key and adds this filter field to the advanced area. If there is no corresponding field in the OData metadata, this method has no effect.
Parameters:
{string}sKey The key like specified in the OData metadata
addGroupConfiguration(oGroupConfiguration): sap.ui.comp.smartfilterbar.SmartFilterBar
Adds some groupConfiguration to the aggregation groupConfiguration.
Parameters:
{sap.ui.comp.smartfilterbar.GroupConfiguration}oGroupConfiguration the groupConfiguration to add; if empty, nothing is inserted
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
applyVariant(oVariant): void
Applies the current variant as opposed to fetchVariant. The variant is retrieved via the flex layer.
Parameters:
{object}oVariant The variant that must be applied. oVariant must contain a valid JSON object.
attachPendingChange(oData?, fnFunction, oListener?): sap.ui.comp.smartfilterbar.SmartFilterBar
Attaches event handler fnFunction to the pendingChange event of this sap.ui.comp.smartfilterbar.SmartFilterBar.

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.smartfilterbar.SmartFilterBar itself.

This event is fired after the pending state of the FilterBar control changes.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.comp.smartfilterbar.SmartFilterBar itself
Since:
1.36
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
destroy()
Destroys the control.
destroyControlConfiguration(): sap.ui.comp.smartfilterbar.SmartFilterBar
Destroys all the controlConfiguration in the aggregation controlConfiguration.
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
destroyGroupConfiguration(): sap.ui.comp.smartfilterbar.SmartFilterBar
Destroys all the groupConfiguration in the aggregation groupConfiguration.
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
detachPendingChange(fnFunction, oListener): sap.ui.comp.smartfilterbar.SmartFilterBar
Detaches event handler fnFunction from the pendingChange event of this sap.ui.comp.smartfilterbar.SmartFilterBar.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Since:
1.36
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
fetchVariant(): object
Retrieves the currently visible filters and the values for storing them as variants. The result will be passed on as a JSON object to the callee smart variant control.
Returns:
{object}
firePendingChange(mArguments?): sap.ui.comp.smartfilterbar.SmartFilterBar
Fires event pendingChange to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Since:
1.36
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
getBasicSearchControl(): object
Returns an instance of the control for the basic search.
Returns:
{object} Basic search control
getBasicSearchFieldName(): string
Gets current value of property basicSearchFieldName.

Name of the field that has to be the focus of basic search. This is only relevant for SmartFilterBar in combination with ValueHelpDialog.

Returns:
{string} Value of property basicSearchFieldName
getControlByKey(sKey): object|sap.ui.Control
Returns the control (if any) with the specified key (Property name in OData entity). Use just the property name as the key when getting a control from the basic area. Example: "CompanyCode" & Use "EntityName/GroupName.FieldName" format to get controls from groups. Example:"Account.CompanyCode"
Parameters:
{string}sKey The key as present in the OData property name/control configuration
Returns:
{object|sap.ui.Control} The control in the filter bar, if any
Gets content of aggregation controlConfiguration.

Using control configurations you can add additional configuration to filter fields, for example set custom labels, change the order of fields, or change the filter field control type. Note: Changing the values here after the SmartFilter is initialized (initialise event was fired) has no effect.

Returns:
{sap.ui.comp.smartfilterbar.ControlConfiguration[]}
getEnableBasicSearch(): boolean
Gets current value of property enableBasicSearch.

Enables basic search field in the SmartFilterBar control. This must only be enabled for entities that support such search behavior.

Default value is false.

Returns:
{boolean} Value of property enableBasicSearch
getEntityType(): string
Gets current value of property entityType.

The OData entity type whose metadata is used to create the SmartFilterBar. Note: Changing this value after the SmartFilterBar is initialized (initialise event was fired) has no effect.

Returns:
{string} Value of property entityType
getFilterData(bAllFilterData): object
Returns the data currently set in the filter data model.
Parameters:
{boolean}bAllFilterData Also include empty/invisible fields filter data
Returns:
{object} The JSON data in the filter bar
getFilterDataAsString(bAllFilterData): string
Returns the data currently set in the filter data model as string.
Parameters:
{boolean}bAllFilterData Also include empty/invisible fields filter data
Returns:
{string} The JSON data string
getFilters(aFieldNames?): sap.ui.model.Filter[]
Returns an array of filters (sap.ui.model.Filter instances), for visible fields, that can be used to restrict the query result from OData.
The result of this method can directly be used during aggregation binding or OData read.
Parameters:
{string[]}aFieldNames? optional array of field names that filters should be returned, if not given all visible filters are returned
Returns:
{sap.ui.model.Filter[]} array of sap.ui.model.Filter or multi-filters
Gets content of aggregation groupConfiguration.

Provides the possibility to add additional configuration to groups. Groups are used to show fields in the advanced area of the SmartFilterBar. With additional configuration, you can for example set custom labels or change the order of groups. Note: Changing the values here after the SmartFilter is initialized (initialise event was fired) has no effect.

Returns:
{sap.ui.comp.smartfilterbar.GroupConfiguration[]}
getParameters(): object
Returns a parameter object that can be used to restrict the query result from OData in case of basic search.
Returns:
{object} A parameter object containing OData query parameters
ID of the element which is the current target of the association smartVariant, or null.
Since:
1.38
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagement}
indexOfControlConfiguration(oControlConfiguration): int
Checks for the provided sap.ui.comp.smartfilterbar.ControlConfiguration in the aggregation controlConfiguration. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.comp.smartfilterbar.ControlConfiguration}oControlConfiguration The controlConfiguration whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
indexOfGroupConfiguration(oGroupConfiguration): int
Checks for the provided sap.ui.comp.smartfilterbar.GroupConfiguration in the aggregation groupConfiguration. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.comp.smartfilterbar.GroupConfiguration}oGroupConfiguration The groupConfiguration whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertControlConfiguration(oControlConfiguration, iIndex): sap.ui.comp.smartfilterbar.SmartFilterBar
Inserts a controlConfiguration into the aggregation controlConfiguration.
Parameters:
{sap.ui.comp.smartfilterbar.ControlConfiguration}oControlConfiguration the controlConfiguration to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the controlConfiguration should be inserted at; for a negative value of iIndex, the controlConfiguration is inserted at position 0; for a value greater than the current size of the aggregation, the controlConfiguration is inserted at the last position
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
insertGroupConfiguration(oGroupConfiguration, iIndex): sap.ui.comp.smartfilterbar.SmartFilterBar
Inserts a groupConfiguration into the aggregation groupConfiguration.
Parameters:
{sap.ui.comp.smartfilterbar.GroupConfiguration}oGroupConfiguration the groupConfiguration to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the groupConfiguration should be inserted at; for a negative value of iIndex, the groupConfiguration is inserted at position 0; for a value greater than the current size of the aggregation, the groupConfiguration is inserted at the last position
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
isPending(): boolean
Checks the pending state of the FilterBar control
Returns:
{boolean} true if at least one FilterItem element of the FilterBar control is pending
removeAllControlConfiguration(): sap.ui.comp.smartfilterbar.ControlConfiguration[]
Removes all the controls from the aggregation controlConfiguration.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.comp.smartfilterbar.ControlConfiguration[]} An array of the removed elements (might be empty)
removeAllGroupConfiguration(): sap.ui.comp.smartfilterbar.GroupConfiguration[]
Removes all the controls from the aggregation groupConfiguration.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.comp.smartfilterbar.GroupConfiguration[]} An array of the removed elements (might be empty)
removeControlConfiguration(vControlConfiguration): sap.ui.comp.smartfilterbar.ControlConfiguration
Removes a controlConfiguration from the aggregation controlConfiguration.
Parameters:
{int|string|sap.ui.comp.smartfilterbar.ControlConfiguration}vControlConfiguration The controlConfigurationto remove or its index or id
Returns:
{sap.ui.comp.smartfilterbar.ControlConfiguration} The removed controlConfiguration or null
removeGroupConfiguration(vGroupConfiguration): sap.ui.comp.smartfilterbar.GroupConfiguration
Removes a groupConfiguration from the aggregation groupConfiguration.
Parameters:
{int|string|sap.ui.comp.smartfilterbar.GroupConfiguration}vGroupConfiguration The groupConfigurationto remove or its index or id
Returns:
{sap.ui.comp.smartfilterbar.GroupConfiguration} The removed groupConfiguration or null
setBasicSearchFieldName(sBasicSearchFieldName): sap.ui.comp.smartfilterbar.SmartFilterBar
Sets a new value for property basicSearchFieldName.

Name of the field that has to be the focus of basic search. This is only relevant for SmartFilterBar in combination with ValueHelpDialog.

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

Parameters:
{string}sBasicSearchFieldName New value for property basicSearchFieldName
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
setEnableBasicSearch(bEnableBasicSearch): sap.ui.comp.smartfilterbar.SmartFilterBar
Sets a new value for property enableBasicSearch.

Enables basic search field in the SmartFilterBar control. This must only be enabled for entities that support such search behavior.

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

Default value is false.

Parameters:
{boolean}bEnableBasicSearch New value for property enableBasicSearch
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
setEntityType(sEntityTypeName)
The entity type name from OData metadata, for which the filter bar is created.
Parameters:
{string}sEntityTypeName type name
setFilterData(oJson, bReplace)
Sets the data in the filter data model. The follow-on filterChange event is only triggered when none _CUSTOM data is set.
Parameters:
{object}oJson The JSON data in the filter bar
{boolean}bReplace Replace existing filter data
setFilterDataAsString(sJson, bReplace)
Sets the data in the filter data model as string.
Parameters:
{string}sJson The JSON data in the filter bar
{boolean}bReplace Replace existing filter data
setSmartVariant(oSmartVariant): sap.ui.comp.smartfilterbar.SmartFilterBar
Sets the associated smartVariant.
Parameters:
{sap.ui.comp.smartvariants.SmartVariantManagement}oSmartVariant Id of an element which becomes the new target of this smartVariant association; alternatively, an element instance may be given
Since:
1.38
Returns:
{sap.ui.comp.smartfilterbar.SmartFilterBar} Reference to this in order to allow method chaining
getResourceUri(): string
Gets current value of property resourceUri.

Optional. The OData service URL. If it is not specified, the service URL from the OData model (this.getModel()) will be used. Note: Changing this value after the SmartFilterBar is initialized (initialise event was fired) has no effect.

Deprecated:
Since 1.29. Set an ODataModel as the main model on your control/view instead
Returns:
{string} Value of property resourceUri
setResourceUri(sResourceUri)
Uses the provided resource URI to fetch the OData metadata instead of using the default ODataModel (getModel()). You should only set this if you intend to get the metadata for the filter bar from elsewhere!
Parameters:
{string}sResourceUri The URI of the oData service from which the metadata would be read
Deprecated:
Since 1.29. Set an ODataModel as the main model on your control/view instead
OData Annotation Detail
FilterRestrictions/NonFilterableProperties(Org.OData.Capabilities.V1)
Defines whether a Property can be used for filtering data. All properties are filterable by default. In order to disable filtering capability, these properties must be excluded.

Note: Currently only OData v2 annotation is supported by the SmartFilterBar control.

XML Example of OData V4 with Excluded Customer and CompanyCode Properties

   <Annotation Term="Org.OData.Capabilities.V1.FilterRestrictions">
     <PropertyValue Property="NonFilterableProperties">
       <Collection>
         <PropertyPath>Customer</PropertyPath>
         <PropertyPath>CompanyCode</PropertyPath>
       </Collection>
     </PropertyValue>
   </Annotation>

For OData v2 the sap:filterable annotation on the Property can be used to exclude properties from filtering.

   <Property Name="Customer" ... sap:filterable="false"/>
   <Property Name="CompanyCode" ... sap:filterable="false"/>

Refer OData v4 annotations for details about annotations.
Target Type:
EntitySet
Interpretation:
Provide the annotation for paths to be excluded. Paths will be included by default.
Applies to Aggregation/Property:
filterItem/#/value
Since:
1.28.1
FieldGroup(com.sap.vocabularies.UI.v1)
Defines a group for a filter field. The value can be provided as a fixed or dynamic value of an enumeration by referencing another Property within the same EntityType.

XML Example for OData V4 with CompanyName and CompanyCode Properties

   <Annotation Term="com.sap.vocabularies.UI.v1.FieldGroup" Qualifier="FieldGroup1">
     <Record>
       <PropertyValue Property="Label" String="my Field Group 1" />
       <PropertyValue Property="Data">
         <Collection>
           <PropertyPath>CompanyName</PropertyPath>
           <PropertyPath>CompanyCode</PropertyPath>
         </Collection>
       </PropertyValue>
     </Record>
   </Annotation>

Refer OData v4 annotations for details about annotations.
Target Type:
EntityType
Applies to Aggregation/Property:
filterGroupItem
Since:
1.28.1
TextArrangement(com.sap.vocabularies.UI.v1)
Describes the arrangement of a code value and its text. The value can be provided as a fixed or dynamic value of an enumeration by referencing another Property within the same EntityType. The enumeration members can have the following values:
  • com.sap.vocabularies.UI.v1.TextArrangementType/TextFirst
    The underlying control is represented with the specified description followed by its ID.
  • com.sap.vocabularies.UI.v1.TextArrangementType/TextOnly
    The underlying control is represented with the specified description only.

XML Example of OData V4 with EntityType ProductType

   <Annotations Target="ProductType">
     <Annotation Term="com.sap.vocabularies.UI.v1.TextArrangement" EnumMember="com.sap.vocabularies.UI.v1.TextArrangementType/TextFirst"/>
   </Annotations>

Refer OData v4 annotations for details about annotations.
Target Type:
EntityType
Applies to Aggregation/Property:
text
Since:
1.32.1
FieldControlType/Hidden(com.sap.vocabularies.Common.v1)
Defines whether the filter is visible. The SmartFilterBar interprets the EnumMemberFieldControlType/Hidden of the FieldControl annotation for setting the visibility.

Note: Currently only FieldControlType/Hidden is supported for statically hiding the filter fields.

XML Example of OData V4 with Hidden Customer and CompanyCode Properties

   <Property Name="Customer">
     <Annotation Term="com.sap.vocabularies.Common.v1.FieldControlType/Hidden"/>
   </Property>
   <Property Name="CompanyCode">
     <Annotation Term="com.sap.vocabularies.Common.v1.FieldControlTpye/Hidden"/>
   </Property>

For OData v2 the sap:visible annotation on the Property can be used to assign visibility.

   <Property Name="Customer" ... sap:visible="false"/>
   <Property Name="CompanyCode" ... sap:visible="false"/>

Refer OData v4 annotations for details about annotations.
Target Type:
Property
Applies to Aggregation/Property:
filterItem/#/visible
Since:
1.32.1
ValueList(com.sap.vocabularies.Common.v1)
Contains annotations that provide information for rendering a ValueHelpList that are set on the Property. Each Parameter on the ValueList annotation has maximum of two properties:
  1. LocalDataProperty - Path to the property on the local entity that triggered the ValueList.
  2. ValueListProperty - Path to property in on the ValueList entity.

XML Example of OData V4 with Category having ValueList

   <Annotation Term="com.sap.vocabularies.Common.v1.ValueList">
     <Record>
       <PropertyValue Property="Label" String="Category" />
       <PropertyValue Property="CollectionPath" String="Category" />
       <PropertyValue Property="SearchSupported" Bool="true" />
       <PropertyValue Property="Parameters">
       <Collection>
         <Record Type="com.sap.vocabularies.Common.v1.ValueListParameterOut">
           <PropertyValue Property="LocalDataProperty" PropertyPath="Category" />
           <PropertyValue Property="ValueListProperty" String="Description" />
         </Record>
         <Record Type="com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly">
           <PropertyValue Property="ValueListProperty" String="CategoryName" />
         </Record>
       </Collection>
     </Record>
   </Annotation>

Refer OData v4 annotations for details about annotations.
Target Type:
Property
Parameter
Applies to Aggregation/Property:
filterItem/#/fieldHelp
Since:
1.28.1
Label(com.sap.vocabularies.Common.v1)
A short, human-readable text suitable for the filter's name. The com.sap.vocabularies.Common.v1.Label annotation is defined on the Property. If the com.sap.vocabularies.Common.v1.Label annotation is given, it has precedence. If none of the annotations are given, then the label will be the Property name.

XML Example for OData V4 where CustomerName is the Label assigned to Customer

   <Property Name="Customer" />
   <Annotation Term="com.sap.vocabularies.Common.v1.Label" Path="Customer" String="Customer Name"/>

For OData v2 the sap:label annotation on the Property can be used to define the label of the column.

   <Property Name="Customer" ... sap:label="Customer Name"/>

Refer OData v4 annotations for details about annotations.
Target Type:
Property
PropertyPath
Applies to Aggregation/Property:
filterItem/label
Since:
1.28.1
LineItem/Label(com.sap.vocabularies.UI.v1)
A short, human-readable text suitable for the filter's name. The Label annotation of com.sap.vocabularies.UI.v1.DataFieldAbstract is defined within com.sap.vocabularies.UI.v1.LineItem annotation. If the com.sap.vocabularies.Common.v1.Label annotation is given, it has precedence. If none of the annotations are given, then the label will be the Property name of the column.

XML Example for OData V4 where CustomerName is the Label assigned to Customer

   <Property Name="Customer">
    <Annotation Term="com.sap.vocabularies.Common.v1.Label" Path="CustomerName" />
   </Property>
   <Property Name="CustomerName" type="Edm.String" />

For OData v2 the sap:label annotation on the Property can be used to define the label of the column.

   <Property Name="Customer" ... sap:label="My Customer"/>

Refer OData v4 annotations for details about annotations.
Target Type:
Property
Parameter
Applies to Aggregation/Property:
filterItem/label
Since:
1.28.1
FilterRestrictions/RequiredProperties(Org.OData.Capabilities.V1)
Defines the filter field as mandatory filter. Filter fields having this annotation must be a part of the $filter request sent to the back-end.

Note: Currently only OData v2 annotation is supported by the SmartFilterBar control.

XML Example of OData V4 with Required CompanyCode Filter

   <Annotation Term="Org.OData.Capabilities.V1.FilterRestrictions">
     <Record>
         <PropertyValue Property="RequiresFilter" Bool="true"/>
         <PropertyValue Property="RequiredProperties">
          <Collection>
             <PropertyPath>CompanyCode</PropertyPath>
          </Collection>
       </PropertyValue>
     </Record>
   </Annotation>

For OData v2 the sap:required-in-filter annotation on the Property can be used for setting the filter as a mandatory filter field.

   <Property Name="Customer" ... sap:required-in-filter="true"/>
   <Property Name="CompanyCode" ... sap:required-in-filter="true"/>

Refer OData v4 annotations for details about annotations.
Target Type:
EntitySet
Applies to Aggregation/Property:
filterItem/#/value
Since:
1.28.1
FilterExpressionRestrictions/MultiValue(com.sap.vocabularies.Common.v1)
Defines whether multiple values can be used in a single filter. With multi-value filtering, more that one "equals" condition can be defined for filtering the data.

Note: Currently only OData v2 annotation is supported by the SmartFilterBar control.

XML Example of OData V4 with Multi-value Customer and CompanyCode Properties

   <Annotation Term="com.sap.vocabularies.Common.v1.FilterExpressionRestriction" 
     EnumMember="com.sap.vocabularies.Common.v1.FilterExpressionType/MultiValue>
     <Record>
       <Collection>
         <PropertyPath>Customer</PropertyPath>
         <PropertyPath>CompanyCode</PropertyPath>
       </Collection>
     </Record>
   </Annotation>

For OData v2 the sap:filter-restriction="multi-value" annotation on the Property can be used for rendering multi-value filter field.

   <Property Name="Customer" ... sap:filter-restriction="multi-value"/>
   <Property Name="CompanyCode" ... sap:filter-restriction="multi-value"/>

Refer OData v4 annotations for details about annotations.
Target Type:
EntitySet
Applies to Aggregation/Property:
filterItem/#/input
Since:
1.28.1
FilterExpressionRestrictions/SingleValue(com.sap.vocabularies.Common.v1)
Restricts the filter to only one single value entry. With single-value filtering, you cannot define more than one "equals" condition for filtering the data.

Note: Currently only OData v2 annotation is supported by the SmartFilterBar control.

XML Example of OData V4 with Single-value Customer and CompanyCode Properties

   <Annotation Term="com.sap.vocabularies.Common.v1.FilterExpressionRestriction"
     EnumMember="com.sap.vocabularies.Common.v1.FilterExpressionType/SingleValue>
     <Record>
       <Collection>
         <PropertyPath>Customer</PropertyPath>
         <PropertyPath>CompanyCode</PropertyPath>
       </Collection>
     </Record>
   </Annotation>

For OData v2 the sap:filter-restriction="single-value" annotation on the Property can be used for rendering a single-value filter field.

   <Property Name="Customer" ... sap:filter-restriction="single-value"/>
   <Property Name="CompanyCode" ... sap:filter-restriction="single-value"/>

Refer OData v4 annotations for details about annotations.
Target Type:
EntitySet
Applies to Aggregation/Property:
filterItem/#/input
Since:
1.28.1
FilterExpressionRestrictions/SingleInterval(com.sap.vocabularies.Common.v1)
Restricts the filter to specify an interval, for example, a date interval for filtering the data present between the given dates.

Note: Currently only OData v2 annotation is supported by the SmartFilterBar control.

XML Example of OData V4 with Interval Restriction on DocumentDate Property

   <Annotation Term="com.sap.vocabularies.Common.v1.FilterExpressionRestriction"
     EnumMember="com.sap.vocabularies.Common.v1.FilterExpressionType/SingleInterval>
     <Record>
       <Collection>
         <PropertyPath>DocumentDate</PropertyPath>
       </Collection>
     </Record>
   </Annotation>

For OData v2 the sap:filter-restriction="interval" annotation on the Property can be used for rendering an interval filter field.

   <Property Name="DocumentDate" ... sap:filter-restriction="interval"/>

Refer OData v4 annotations for details about annotations.
Target Type:
EntitySet
Applies to Aggregation/Property:
filterItem/#/input
Since:
1.28.1