-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case insensitive filter #1141
Comments
Hello Jan, good idea, it has been requested a lot of times already and it seems to be a missing feature in the odata specification. While we could add new filter operators in the odata model itself, the standard would not support it. There are two very common workarounds:
See also typical posts about this on goolge: Nevertheless i will forward your request to the OData experts so that they can take your enhancement as input and follow up with you. Kind Regards, |
Is there an update about this issue/request? Cheers, Emanuele. |
Hi Michael, when I look at the OData URI Conventions I find the option tolower. Here are some live examples which show that if SAPUI5 would support such a filter that we could get results:
I hope that the option which is part of the OData Standard and also is supported in SAP HANA can be added soon. Best regards |
Hi @gregorwolf I can confirm that with our actual project we're folliwing that example. Here's how to create the filter createFilter: function(key, value, operator, useToLower) {
return new Filter(useToLower ? "tolower(" + key + ")" : key, operator, useToLower ? "'" + value.toLowerCase() + "'" : value)
}, |
As @gregorwolf already mentioned, tolower and toupper are part of the oData v2 URI conventions so it would be nice if ui5 and gateway would support them. |
Hi guys,
An ILIKE operator would be more useful. Hope that helps |
I was able to implement @StErMi solution above using the 'createFilter' function he provided:
Cheers, Tim |
I would mark this as a critical bug instead of an enhancement... |
I searched the web but am not able to find the solution to it. Is it still in progress or do we have a solution for Filters case insensitive? |
What error does it throw? The implementation on the frontend side is correct but it doesn't mean that the backend part support the tolower function |
Thanks, got it! |
Please see property caseSensitive of sap.ui.model.Filter. |
Is there any solution for this? The F12 menu bursts into errors like this:
when filtering with tolower function, caseSensitive option does not help either. |
Did you find any solution or workaround for it? |
Hi, I have build a small test with Northwind and added the following filter.
This works like a charm. I have tested OpenUI5 1.60.1, 1.60.36, 1.71.33, 1.84.13 and 1.90.1. What needs to be done to reproduce the errors listed above? Best regards |
As @uhlmannm and @ThomasChadzelek already wrote #1141 (comment). It's already supported. So, I close the issue. If it's still relevant, feel free to open a new one by providing a small sample to reproduce the issue. |
It would be nice if the ODataModel filter would support case insensitive filtering besides the current default filtering. When this case insensitive filtering would be used, instead of e.g.
The following filter would be used:
You could think of e.g. implementing this using an additional set of operators, perhaps pre- or postfixed with an "I" to indicate they're case-insensitive:
and
The text was updated successfully, but these errors were encountered: