Skip to Content

SAPUI5 Display Time field in XML

Nov 17, 2016 at 08:04 AM


avatar image


I am receiving data from OData and want to display it in SAPUI5. All the fields display fine except the value in the Time field does not get displayed. I am sure it has to be a syntax error as I get this message in Chrome Diagnostics:

path : 'Counter', type : 'sap.ui.model.type.Time', formatOptions: { source: { pattern: 'timestamp' }, pattern: 'HH:mm:ss' (invalid)

This is the value pulling through: PT23H59M59S

I have tried to rewrite this statement over and over removing all the format options but I can't get past the Invalid message.

Any suggestions would really be appreciated

Here is my code:

	         <ColumnListItem press="onItemSelected">
		          <Text text="{Trainid}" />
		          <Text text="{
		                path : 'Counter', 		            
		                type : 'sap.ui.model.type.Time',
		                formatOptions: {
		                  source: { pattern: 'timestamp' },
		                  pattern: 'HH:mm:ss'
                                       }" />
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers