on 08-08-2013 6:33 AM
Hi ,
I am trying to get the data from oDataModel before it gets bound to the list , in the view .I have tried to set my model in the attach request completed delegate method.
appC.oModel.attachRequestCompleted(function(evt){
alert("Request Completed" + "--");
var name = sap.ui.getCore().getModel().getData();
console.log(name);
});
I am invoking the REST service using oData Model constructor:
appC.oModel = new sap.ui.model.odata.ODataModel(sServiceUrl1,false, "usr", "pwd" , mHeaders);
I am expecting variable name should have , the data of the collection , but I am always getting null.
Regards
Nidhideep Bhandari
Hello,
You could try the following statement:
jQuery.ajax({
url: url,
type: "GET",
dataType: "jsonp",
success: function(data, textStatus, jqXHR) {
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(data);
// insert your logic here
},
error: function(data, textStatus, jqXHR) {
// insert your logic here
}
});
Kindly
Regards,
Arthur Silva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
maybe "Using Factory Functions" will help: https://sapui5.hana.ondemand.com/sdk/#docs/guide/BindingAggregations.html
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.