Skip to Content

binding the OData based model to the fields of the view.

Hi all,

I am just trying to bind the data taken from an OData service with the View of the sapui5.

But there is some binding issue as the data is not visible on the view.

Here is the Controller section.capturecare1.png

this is way I binded the model with the fields of the view.capturecare2.png

The format of data is:capturecare3.png

despite of getting the data, I am not able to view it on the table.

Please suggest me something for the same.

Thanks and Regards,

Aakanksha Gupta

capturecare1.png (9.0 kB)
capturecare2.png (30.1 kB)
capturecare3.png (9.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Mar 16, 2017 at 07:00 AM

    try using bindRows and remove items property from the table declaration (i.e. items: "{path: model1>/DLSet}")

    oTable.setModel(your model);
    oTable.bindRows ("model1>/DLSet");

    hope this help.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Aakanksha,

      you can check model.oData or model.getData() to read the data from model not value. well,

      nothing major issue i can see, see example in below link and follow the same, hope very minor thing you might have missed out, may be you can set model to view instead of core what you have done.

      Table binding , hope this help.

      Thanks

  • avatar image
    Former Member
    Mar 16, 2017 at 08:04 AM

    In your code change "items" to "rows". it should be done.

    var oTable = new sap.ui.table.Table({
    rows:"{model1>/DLSet}"
    });
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 17, 2017 at 06:05 AM

    Hi Akanksha,

    sap.ui.table.table doesn't have aggregation called "items". It is "rows". Refer https://sapui5.hana.ondemand.com/#docs/api/symbols/sap.ui.table.Table.html#constructor

    Regards,

    Shilpa

    Add comment
    10|10000 characters needed characters exceeded