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

Re: Binding problem with Master/Detail in SAP UI 5 and OData

$
0
0

Hi ,

Use this.

 

  • if(pageId=="Detail") { 
  • // // Using OData model to connect against a real service 
  •   var url = "/sap/opu/odata/sap/ZDUEITEMS_SRV"
  •   //myPath = path; 
  •   var oModelDetail = new sap.ui.model.odata.ODataModel(url, true); 
  •   oModelDetail.read(context.getPath(), null, {"$expand":"DueAmountsSet"}, false, function(oData, oResponse){ 
  •         // create JSON model 
  •         var oODataJSONModel =  new sap.ui.model.json.JSONModel(); 
  •         // set the odata JSON as data of JSON model 
  •         oODataJSONModel.setData(oData); 
  •    
  •         // store the model  
  •         sap.ui.getCore().setModel(oODataJSONModel, "MyJSONModel"); 
  •         
  •         var chart = page.byId("dueDateChart"); 
  •         chart.setModel(oODataJSONModel); 
  •         
  •    }, function(){ 
  •         alert("Read failed"); 
  •    } 
  •   ); 
  •   } 
  • In addition we changed our dataset:
  • var dataset = new sap.viz.ui5.data.FlattenedDataset({ 

                dimensions : [ { 

                  axis : 1

                  name : 'NoOfDays'

                  value : "{NoOfDays}" 

               } ], 

                measures : [ { 

                  name : 'DueAmount'

                  value : '{DueAmount}'

                }], 

                data : { 

                  path : "/DueAmountsSet/results" 

                } 

              }); 


  • this may helpflu to you.

Viewing all articles
Browse latest Browse all 8451

Trending Articles



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