Skip to Content

Update Model when data changed in table

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 07, 2015 at 08:47 PM

    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

    Add comment
    10|10000 characters needed characters exceeded