cancel
Showing results for 
Search instead for 
Did you mean: 

Update Model when data changed in table

joerg_arndt
Participant
0 Kudos

Hi Friends,

I have bound a table to Model like this.

var oModel = new sap.ui.model.odata.ODataModel(serviceUrl, true);

var oTable = sap.ui.getCore().byId("ID_ESNTable");

oTable.setModel(oModel);

oTable.bindRows(gVEntity);

The table is filled, everyting is fine.

But now I change some data in the table and want to save it, but when I read the Model still the old data are shown.

With  sap.ui.model.json.JSONModel() I see the changes in the moment I change an entry,  but with the  sap.ui.model.odata.ODataModel still the old data are there.

Do I haveto refresh the Model?

Thanks in advance

Joerg

Accepted Solutions (1)

Accepted Solutions (1)

kedarT
Active Contributor
0 Kudos

Hi Joerg,

Look at the below link:

OData Write Support - SAPUI5 Developer Guide - SAP Library

Make sure you have the set two binding for your model using below code.

oModel.setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);

Hope this helps.

Regards,

Kedar

joerg_arndt
Participant
0 Kudos

Hi Kedar,

thanks for the hint. It works, but now some dropdowns don't working any more and in table only one line works with dropdown.

Rg. Joerg

kedarT
Active Contributor
0 Kudos

Hi Joerg,

I am not getting the issue can elaborate it further.

Regards,

Kedar

Answers (0)