on 11-26-2014 7:48 AM
Hi,
How to bind oDataModel to sap.ui.view?
Below is my code, I am not sure how to proceed further in order to see my data in my view.
sap.ui.core.UIComponent.extend("sap.ui.demo.myFiori.Component", {
createContent : function() {
// create root view
var oView = sap.ui.view({
id : "app",
viewName : "sap.ui.demo.myFiori.view.App",
type : "JS",
viewData : { component : this }
});
var url = service + "/ES_GETSYS";//?$filter=Reqtyp eq 'FUL'";
var oModel = new sap.ui.model.odata.ODataModel(url, false, "user", "password");
oView.setModel(oModel);
return oView;
}
});
I got the error that ES_GETSYS is an entity set, not an entity type. So I removed the entity set and changed the above lines to:
var oModel = new sap.ui.model.odata.ODataModel(service, false, "user", "password");
oView.setModel(oModel);
return oView;
Now I don know how to bind the return data to oView?
Please help.
Best Regards,
Seyed Ismail MAC
Hi Seyed,
I am also new to SAPUI5. But acc to my knowledge we can bind the data available in the models to the controls .
for example if you want to bind the data to the table you can use "bindrows" fuction.
suppose you used a list in mobile applications the we can use "binditems" function
first of all you need to know about what are the binding types in SAPUI5 follow the below url
if you know about those then it is well and good.
I think We cannot directly set the model(data from backend i.e. url) directly to the view . we can assign model to the any of the controls like tables or items in list
Please let me know if i am wrong
Thanks&Regards
Ramu Vedula
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.