Skip to Content

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

Mar 16, 2017 at 05:45 AM


avatar image

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Akhilesh Upadhyay 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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Akhilesh,

Thank you for the help.

But it is not working for it as well. I tried this as well.

I tried to print the value of the model in the view using console command.

But the value is undefined.

data is visible only at the controller end, but the value is not getting passed to the view.

Could you just suggest me a way of updating the value of any field using its controller.

Thanks and Regards,

Aakanksha Gupta


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.


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({
10 |10000 characters needed characters left characters exceeded
Shilpa Ramamurthy
Mar 17, 2017 at 06:05 AM

Hi Akanksha,

sap.ui.table.table doesn't have aggregation called "items". It is "rows". Refer



10 |10000 characters needed characters left characters exceeded