11

Date/Time Fields in Fiori Elements with CAP and OData V2 Proxy are not displayed

 1 year ago
source link: https://answers.sap.com/questions/13772441/datetime-fields-in-fiori-elements-with-cap-and-oda.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
yesterday

Date/Time Fields in Fiori Elements with CAP and OData V2 Proxy are not displayed

57 Views

Hi experts,

I have a CAP application with the OData V2 proxy.
For this I have generated a Fiori Elements App with V4 and V2.
You find the app here: https://github.com/marianfoo/ui5-cc-excelUpload-sampleapp

In CAP I have defined four elements that have to do date/time:

validFrom : DateTime;
timestamp : Timestamp;
date : Date;
time : Time;

In V4 I have no problems with create and display.
In V2 I also have no problem with create, but with display.
None of the above mentioned elements are displayed.
For example when i open OrderNo 2 and open OrderItems 252 Eleonora i get this error and the date is empty:

image.png
Log-dbg.js:452 2022-12-09 13:45:13.585300 FormatException in property 'text' of 'Element sap.m.Text#ui.v2.ordersv2::sap.suite.ui.generic.template.ObjectPage.view.Details::Orders_Items--com.sap.vocabularies.UI.v1.Identification::date::Field-text': Illegal sap.ui.comp.smartfield.type.DateTime value: /Date(1640995200000)/
Hint: single properties referenced in composite bindings and within binding expressions are automatically converted into the type of the bound control property, unless a different 'targetType' is specified. targetType:'any' may avoid the conversion and lead to the expected behavior. -

Here the correct result in the V4 App

image.png

What could be the cause of this error?
The only bugs I found in this direction with CAP are already older and fixed.

Thank you for your help!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK