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.95k stars 1.24k forks source link

FacetFilterList: FacetFilterListDataType does not work as advertised for Date/Datetime types #2855

Open rpbouman opened 4 years ago

rpbouman commented 4 years ago

OpenUI5 version: 1.75.0

Browser/version (+device/version): Chrome latest

Steps to reproduce the problem:

I have a facetfilter, and use data binding against an Odata Metamodel to generate a FacetFilterList for each property. I map the Odata data types to the closest FacetFilterListDataType like so:

Edm.DateTime -> sap.m.FacetFilterListDataType.DateTime

The documentation at https://sapui5.hana.ondemand.com/#/api/sap.m.FacetFilterListDataType states: "An input control for specifying a date and time value. The user can select a month, day of the month, year, and time of day."

I bind the items aggregation of the FacetFilterList to the entity, with a select param to select only the property that is required to populate the list. When I do this, I must provide a template (or factory), and I bind the text and key properties to my property

What is the expected result?

For date/datetime/time types, I expected to see some kind of date/time picker.

What happens instead?

I get the list of date time values - no control to pick a date.

rpbouman commented 4 years ago

In addition, I should add that I bound the key and text of the list items to my property.

But internally, the key gets converted to a string. In case of OData DateTime and Datetime Offset values, the key becomes the string representation of the Date value, which means the milliseconds data gets truncated.

This means that when the user makes a selection, and we try to use the key to create a filter condition to filter the data set for which this is a facet filter, we might not (usually will not) find any rows, since our original data set has the full date (with millis) but the date extracted from the key only has seconds resolution.

In short, the FacetFilter is currently unusable for temporal types :(

rpbouman commented 4 years ago

mm, it turns out I can solve the latter problem by adding a formatter to the key binding and then bind the ISO string representation of my javascript Date value.

However, the point remains with regard to the value control. Perhaps the concept of a facetfilter is only for string types, but then I don't get why we have all those different facet filter data types.

What would work is if the facet filter list and facet filter items would have some extension point so we can customize the control that is being rendered.

rpbouman commented 4 years ago

Hi Irina!

thanks for taking a look.

Hi, seems to be more a question or extension as a bug

I respectfully disagree. What is the purpose of the "dataType" property of the FacetFilterList?

The available values are in FacetFilterListDataType https://sapui5.hana.ondemand.com/#/api/sap.m.FacetFilterListDataType And there, the values or date and date time clearly read:

sap.m.FacetFilterListDataType.Date https://sapui5.hana.ondemand.com/

An input control for specifying a date value. The user can select a month, day of the month, and year. Visibility: publicEntry successfully validated sap.m.FacetFilterListDataType.DateTime https://sapui5.hana.ondemand.com/

An input control for specifying a date and time value. The user can select a month, day of the month, year, and time of day. Visibility: public

Since using these data types do not produce any kind of control that resembles the described functionality, I would label this a bug.

On Thu, Mar 26, 2020 at 6:54 PM Irina notifications@github.com wrote:

Hi, seems to be more a question or extension as a bug. As I understand your current problem is solved, but the general question of the implementation or extensibility is still open. I label it as extension and we will see what we can do on it, br, Irina

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SAP/openui5/issues/2855#issuecomment-604582172, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE6BE4ZY2HS4VU4A3ALD4TRJOJGZANCNFSM4LR454LA .

-- Roland Bouman blog: http://rpbouman.blogspot.com/ twitter: @rolandbouman linkedin: http://www.linkedin.com/profile/view?id=5142800&trk=tab_pro

irinagoetz commented 4 years ago

Hi Roland, Thank you for sharing this finding. I've created an internal incident 2070120781. The status of the issue will be updated here in GitHub. Regards,

unazko commented 4 years ago

Hello Roland,

Thank you for sharing this finding.

As you correctly pointed out in the following documentation: https://sapui5.hana.ondemand.com/#/api/sap.m.FacetFilterListDataType is implied that in the sap.m.FacetFilter different type of input controls would be rendered according to the sap.m.FacetFilterList "dataType" property.

Apparently this behavior was supposed to be implemented, but I can confirm that it isn't. According to the current implementation only "FacetFilterListDataType.String" value is supported for "dataType" property of the sap.m.FacetFilterList. If any other type is used, than the searching functionality in the list gets disabled.

For reference: https://sapui5.hana.ondemand.com/#/api/sap.m.FacetFilterList%23controlProperties

Unfortunately, the sap.m.FacetFilter control is out of maintenance from UX side. UX designers recommend to use the sap.ui.comp.filterbar.FilterBar control, which covers all features from the sap.m.FacetFilter and more.

For reference see the following simple snipped: https://jsfiddle.net/unazko/qaodgtes/1/

A decision was made to edit the documentation of the sap.m.FacetFilterListDataType in order not to imply functionalities that aren't present.

Thank you and Best Regards, Boyan Rakilovski

rpbouman commented 4 years ago

Hi Boyan!

thanks for your reply! All understood.

Unfortunately, the sap.m.FacetFilter control is out of maintenance from UX side.

that is a pity indeed :(

UX designers recommend to use the sap.ui.comp.filterbar.FilterBar control,

That is also a pity. Our users hate that one and they get lost in it. Too complex.

Anyway - I guess we can't always get what we want.

I appreciate your clear response. Thanks again, and best regards!

Roland.

On Wed, Apr 8, 2020 at 6:44 PM Boyan Rakilovski notifications@github.com wrote:

Hello Roland,

Thank you for sharing this finding.

As you correctly pointed out in the following documentation: https://sapui5.hana.ondemand.com/#/api/sap.m.FacetFilterListDataType is implied that in the sap.m.FacetFilter different type of input controls would be rendered according to the sap.m.FacetFilterList "dataType" property.

Apparently this behavior was supposed to be implemented, but I can confirm that it isn't. According to the current implementation only "FacetFilterListDataType.String" value is supported for "dataType" property of the sap.m.FacetFilterList. If any other type is used, than the searching functionality in the list gets disabled.

For reference:

https://sapui5.hana.ondemand.com/#/api/sap.m.FacetFilterList%23controlProperties

Unfortunately, the sap.m.FacetFilter control is out of maintenance from UX side. UX designers recommend to use the sap.ui.comp.filterbar.FilterBar control, which covers all features from the sap.m.FacetFilter and more.

For reference see the following simple snipped: https://jsfiddle.net/unazko/qaodgtes/1/

A decision was made to edit the documentation of the sap.m.FacetFilterListDataType in order not to imply functionalities that aren't present.

Thank you and Best Regards, Boyan Rakilovski

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SAP/openui5/issues/2855#issuecomment-611066845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE6BE5R3RZZD5APXLV6LNLRLSSWJANCNFSM4LR454LA .

-- Roland Bouman blog: http://rpbouman.blogspot.com/ twitter: @rolandbouman linkedin: http://www.linkedin.com/profile/view?id=5142800&trk=tab_pro

rpbouman commented 3 years ago

A decision was made to edit the documentation of the sap.m.FacetFilterListDataType in order not to imply functionalities that aren't present.

Thank you and Best Regards, Boyan Rakilovski

@unazko, this has been quite a while but I just noticed the documentation was never updated:

https://sapui5.hana.ondemand.com/#/api/sap.m.FacetFilterListDataType

flovogt commented 2 years ago

This issue will be covered in backlog item BGSOFUIBALKAN-5402.