Skip to Content
-1

Odata Binding using WEBIDE SAPUI5 Template

Sep 21, 2017 at 10:19 AM

186

avatar image
Former Member

Hey people,

Im having a problem in displaying my Odata on my app using the SAPIU5 template.

I did all the data binding in manifest.json as usual: creating a Data source first and then binding this Data source to a model.

But i really dont know where do i call this model, i thought it could be on models.js file, but it didnt work. Also when i try to use the omodel I ve created direct on my View, it doesnt work...

does anyone know how to proceed after creating a OData model and vizualize it on your SAPUI5 App

view.png

sap-web-ide.png (59.9 kB)
model.png (61.3 kB)
modeljscode.png (53.8 kB)
view.png (63.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Joseph BERTHE Sep 21, 2017 at 07:32 PM
0

Hello,

If you have configure your OData model inside the manifest.json file, then your model should be available anywhere in your application.

So, if your model is named SensorData (the default flag is not set in the manifest), then in onInit function you can do this (in a view controller):

var oModel = this.getView().getModel("SensorData");
or 
var oModel = this.getOwnerComponent().getModel("SensorData");

Regards,

Share
10 |10000 characters needed characters left characters exceeded