SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.91k stars 1.23k forks source link

OData v4: filtering fails #1430

Open supernevi opened 7 years ago

supernevi commented 7 years ago

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:

  1. Take any odata-service and configure it in the manifest.json
  2. Build up a minimal OpenUI5-App with a sap.ui.table.Table
  3. connect the table with the service (in this example "Rolle")
  4. run your app and see that all data is listed in the table
  5. 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: webansicht

The console-output, when i try to filter: console

My actual metadata: metadata

The result for "http://localhost/OData.svc/Rolle" rollecollection

My sourcecode for the table: quellcode

ThomasChadzelek commented 7 years ago

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

supernevi commented 7 years ago

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

ThomasChadzelek commented 7 years ago

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...

supernevi commented 7 years ago

Hello Thomas,

thanks for your advice.

Do you know if it is planned to integrate "BaseType"-support in UI5 (soon)?

Best Regards, Sven

ThomasChadzelek commented 7 years ago

We are aware that "BaseType" support is missing, but I cannot make any promises regarding the timeline. Sorry.

ThomasChadzelek commented 7 years ago

Internal backlog item is CPOUI5UISERVICESV3-499