cancel
Showing results for 
Search instead for 
Did you mean: 

ui5 table shows same records

former_member224398
Participant
0 Kudos

Hi All,

I'm facing an error while showing the data in ui5 table. We have two time related fields in the table where we have exposed via XSodata service. Problem is while displaying the data in the ui5 table all the time related columns are displaying the same time for eg (19:08 ,20:08 , 14:08 etc).ed which is shown in below screenshot.

When i check the data in my odata output url i'm getting the same data as we have in the table.

below is my output of the ui5 table which has issues in columns Start time and End time

Below is the metadata of the XSODATA service.

<EntityType Name="monload_serviceType">
<Key>
<PropertyRef Name="GENERATED_ID"/>
</Key>
<Property Name="GENERATED_ID" Type="Edm.String" Nullable="false" MaxLength="2147483647"/>
<Property Name="USERID" Type="Edm.String" MaxLength="10"/>
<Property Name="SOURCE" Type="Edm.String" MaxLength="10"/>
<Property Name="DATASET" Type="Edm.String" MaxLength="10"/>
<Property Name="DATE" Type="Edm.DateTime"/>
<Property Name="START_TIME" Type="Edm.DateTime" Nullable="false"/>
<Property Name="END_TIME" Type="Edm.DateTime"/>
<Property Name="STATUS" Type="Edm.String" MaxLength="20"/>
<Property Name="ERROR" Type="Edm.String" MaxLength="50"/>
</EntityType>

Code of data binding from View.js

template: new sap.ui.commons.TextView().bindProperty("text",{ path : "START_TIME" , type: new sap.ui.model.type.DateTime({pattern: "HH:MM:SS X"})});

template: new sap.ui.commons.TextView().bindProperty("text",{ path : "END_TIME" , type: new sap.ui.model.type.DateTime({pattern: "HH:MM:SS X"})}),

Please help with your valuable inputs.

Thanks,

Anurag

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

if your odata is wrong, nothing to do with the ui5

where is your xs code

former_member224398
Participant
0 Kudos

in XSodata file i have just written a single line to expose the data .

service{

"T_DL_MON_UI5" as "monload_service" keys generate local "GENERATED_ID";

}

Correct me if I'm wrong with the XSodata definiation.

Below is the example of one property where you can see dates are coming correctly. Kindly suggest where i need to correct.

<m:properties>
<d:GENERATED_ID m:type="Edm.String">48571820155014911</d:GENERATED_ID>
<d:USERID m:type="Edm.String">1101</d:USERID>
<d:SOURCE m:type="Edm.String">EFR</d:SOURCE>
<d:DATASET m:type="Edm.String">ACTUAL</d:DATASET>
<d:DATE m:type="Edm.DateTime">2017-08-29T00:00:00.0000000</d:DATE>
<d:START_TIME m:type="Edm.DateTime">2017-08-29T13:18:06.0000000</d:START_TIME>
<d:END_TIME m:type="Edm.DateTime">2017-08-29T13:59:54.0000000</d:END_TIME>
<d:STATUS m:type="Edm.String">Completed</d:STATUS>
<d:ERROR m:type="Edm.String"/>
</m:properties>
former_member224398
Participant
0 Kudos

Hi Jun,

Can you please help me on this?

Thanks,

Anurag

junwu
Active Contributor
0 Kudos

bind to odata model if it is not the case now.

former_member224398
Participant
0 Kudos

I have already bind the table with odata model . Here it is.

All other columns are coming correctly but which is having the time values those are not populating correctly.

oTable.setModel(oModel);
   oTable.bindRows("/monload_service");