openui5
openui5 copied to clipboard
OData v4: filtering fails
OpenUI5 version: 1.44.8 (but also with 1.44.9 & 1.46.5)
Browser/version (+device/version): Chrome 57.0.2987.98 (64-bit) on Windows 7 (64-bit)
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible): Any standard odata-service-url
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
- Take any odata-service and configure it in the manifest.json
- Build up a minimal OpenUI5-App with a sap.ui.table.Table
- connect the table with the service (in this example "Rolle")
- run your app and see that all data is listed in the table
- now try to filter in that table
What is the expected result? -> list will trigger a request to the server, and there the data will be filtered ( -> Filtermode: Server)
What happens instead? -> fail: "Failed to create cache for binding [...]. Error: Type cannot be determined, no metadata for path: /Rolle [...]"
Any other information? (attach screenshot if possible) Even if i try the free service "http://services.odata.org/V4/Northwind/Northwind.svc/" it fails, too (but due another problem: the request method is automatically "OPTIONS", so the server responses with "501 Not Implemented")
I really can't figure out what goes wrong. Is it possible that this is simply not fully implemented to filter in tables?
Strange behavior: When I use static filtering ( "$filter: [...]" ) it works all fine, but if I use dynamic filtering, then the error occurs. (https://openui5.hana.ondemand.com/#docs/guide/5338bd1f9afb45fb8b2af957c3530e8f.html)
My App:
The console-output, when i try to filter:
My actual metadata:
The result for "http://localhost/OData.svc/Rolle"
My sourcecode for the table:
Hello supernevi!
As far as I can tell, your scenario fails due to our missing support for "BaseType". Can you try to create a service which does not use "BaseType", please?
Best regards, Thomas
Hello Thomas,
thanks for your reply!
I'll check this. But still the strange thing is, that all works with static filtering...
Best Regards, Sven
Hello Sven,
if you give a $filter, that's already the final string we send to the server. If you use dynamic filters, we have to create the $filter string and to do so, we need metadata (e.g. to see which property is a string etc.). That's the moment when we fail due to missing "BaseType" suppport. Sorry!
Best regards, Thomas
P.S.: Starting with 1.45, you might also use ODataListBinding#changeParameters to dynamically change $filter. This would even work with "BaseType". But it does not integrate with the table column's filter UI...
Hello Thomas,
thanks for your advice.
Do you know if it is planned to integrate "BaseType"-support in UI5 (soon)?
Best Regards, Sven
We are aware that "BaseType" support is missing, but I cannot make any promises regarding the timeline. Sorry.
Internal backlog item is CPOUI5UISERVICESV3-499