SmartVariant of smartFilterbar with time filter throws format error

19 Views Asked by At

I build a simple control consisting of a smartTable and a corresponding smartFilterBar where the filters can be saved in a smartVariant. However, one of the possible filters is a time filter (e.g. 12:00:00) and after saving the variant and reloading (or selecting the variant), the control throws an error:"callback for applying data throws an exception" (_applyVariantFields, FilterBar-dbg.js:6371) and the time filter is not set. I encountered in another application where I implemented the "onBeforeVariantSave" method and the filterData is expanded by _CUSTOM and then reset with setFitlerData, it throws a formatException error for the time filter:"Illegal sap.ui.model.odata.type.Time value "1970-01-01-T12:00:00.000Z""

I tried changing the time format into various other formats before saving resulting in nearly the same error:"Illegal sap.ui.model.odata.type.Time value null". After that I had a deeper look inside the control and how the time value is save. There I encountered, that somehow the control checks before saving for an odata time and when loading the variant it checks for an 'Edm.Time'. I kinda solved this problem by changing the format of the time and resetting the filterData after loading the variant, so the filter is applied and showed correctly. However it still throws the first error, because the variant is loaded two times, one time before the filterBar is initialized and one time after. Has anyone encountered a similar problem and has solved this?

0

There are 0 best solutions below