Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: Convert ODataModel in JSONModel

$
0
0

Hi Christian,

 

thanks a lot. Here is what I did:

 

onInit():

var sServiceUrl = this.getUrl("/sap/opu/odata/sap/Z_MY_SERVICE_SRV/");
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,true,"user","pass");       
oModelJson = new sap.ui.model.json.JSONModel();
oModel.read("/Items", null, ["$filter=ImItems eq 'imputParameter'"], null, function(oData, oResponse){    oModelJson.setData(oData);
}, null );
sap.ui.getCore().setModel(oModelJson, "myModel");

 

createContent():

new sap.m.DisplayListItem ({    label: "My label",    value: "{myModel>/results/0/Property}",
}),    

 

Feels kind of a hack, but it works...

 

Regards,

Stefan


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>