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);
}