on 2018 May 04 5:15 PM
Hi -
I have Fiori template based List report with XSODATA based oData service and have a filter bar with text filter ( Example - Customer Name).
Problem is filter is case sensitive and does not return results unless the exact text is typed in which is poor user experience.
Is there a way we can make filter bar case insensitive? any trick that may work on xs odata side or any API reference can be used in list report extensions ?
Request clarification before answering.
Hi Tanveer,
HANA will issue a EQ statement on the field. So this has to be exact criterion. I couldn't find any xsodata definition parameter that would control/change this EQ to CONTAINS statements against the database source. So you will need to create an extension on the controller for the List Report and implement/change the filter that is being set before the odata service is called via controller method onSearch.
You could do it like:
var oFilter = new Filter("CustomerName", FilterOperator.Contains, sQuery);
this._oTable.getBinding("items").filter([oFilter]);
Here are the docs for the Filter.
Another workaround is to change the query string to uppercase before it gets to be sent as query string to the odata.
Regards,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tanveer,
With reference to above answer from Ivan, you can refer this blog for more clarification on how to change query string before sending it to oData call : case-insensitive-filters-in-fiori-elements-list-report-cap
Regards,
Kishan
User | Count |
---|---|
45 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.