cancel
Showing results for 
Search instead for 
Did you mean: 

SmartFIlterBar SelectOption

Former Member
0 Kudos

I am attempting to set the default filter operator on a smartfilterbar customcontrol:

<smartFilterBar:SmartFilterBar id="gSmartFilterBar" entitySet="Client" persistencyKey="gSmartFilterBar_Explored">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="client_name" label="Client" visibleInAdvancedArea="true"
preventInitialDataFetchInValueHelpDialog="false">
<smartFilterBar:defaultFilterValues>
<smartFilterBar:SelectOption operator="Contains"></smartFilterBar:SelectOption>
</smartFilterBar:defaultFilterValues>
</smartFilterBar:ControlConfiguration></smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>

When a user types in the filter value and hits the 'Go' button, the filter is still passed to the backend as 'EQ'. I can open the field valuehelp/control, and specifically select 'Contains' as the filter operator, and that seems to work. However, I would prefer if the user can type in the query string and hit Go to acheive the same result.

Is the preferred method to use the 'onBeforeRebindTable()' method instead, grabbing the control key value and manually passing a filter with preferred operator? If so, does that negatively interact with the default method in the custom control (passing EQ as the filter operator)?

Thanks in advance!

michaela_schlage
Explorer
0 Kudos

Hi,

I have the same problem. The normal way is typing *xxxx* in the filter field then it would use filter operator contains.
But I know this is not the same and also I am looking for another way.

When somebody has the answer this would be very helpful.

Accepted Solutions (0)

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

You need to add custom data to SmartFilterBar. So this is at SmartFilterBar.

<mvc:View controllerName="cis.mm.controller.List" xmlns:mvc="sap.ui.core.mvc"  xmlns:sfb="sap.ui.comp.smartfilterbar" xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1">

<sfb:SmartFilterBar id="listFilterBar" app:useContainsAsDefaultFilter="true">