Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Data binding issue with JSON Model

$
0
0

Hi,

 

I am reading data from SAP using OData Model and creating the JSON Model base on that. Following code I have written in Component.js file for reading the data.

 

oModel = new sap.ui.model.odata.ODataModel(sUrl, true);

 

oModel.read("DealCollection", null, null, false, function(oData, oResponse){

 

var oJsonModel = new sap.ui.model.json.JSONModel(oData);

oView.setModel(oJsonModel);

sap.ui.getCore().setModel(oJsonModel);

   });

  

 

Now I am trying to bind items for List control in Master view with following code:

 

<List id="list" mode="{device>/listMode}" select="handleListSelect" items="{/DealCollection}">

 

 

But its not displaying any data in list. I have debug and check, data is coming correctly in JSON Model. Not sure why its not display data in List. Am I missing something there?

 

If I use ODataModel or JSONModel with file path, List binding works and displaying the data. But with above approach, converting ODataModel to JSONModel, List control binding is not working and not displaying any data.

 

Any suggestion?

 

Regards,

Vikram


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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