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

Data Binding not working

$
0
0

We are trying to bind data from controller to view but for some reason We are unable to display data in the view.

The data in the model is loaded fine and if we set a timeout we can display the data in the view, but this isn't a good solution, it's a crap!!!!

 

 

An example of our code:

 

onInit: function() {     

   var jsonResults = new sap.ui.model.odata.ODataModel(app.loadData.getServiceUrl("OUR_SERVICE"),false,username,password);

   jsonResults.read(requestUri, {

                      async:true, success: function(oData,response){

                           if(!jQuery.isEmptyObject(oData,response)){

                              jsonOrderDetails.setData(oData) ;

                             sap.ui.getCore().setModel(jsonOrderDetails, "orderDetailModel");

                           }

                      },

                     error: function(response){

                         fallback(parameters,oController);

                     }

   });

},

 

 

onBeforeRendering: function() {

 

              setTimeout(function() {

                   panel.setModel(sap.ui.getCore().getModel("orderDetailModel"));   

                  table.setModel(sap.ui.getCore().getModel("orderDetailModel")); },

              800);

}


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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