Hi All,
Having the problem in displaying the data in the table in view.(No data). But I can see the value's coming from back end(sap)
Am using the function import to get the component details and try to set the oData.results to model with the name "compModel"
and get the model value in the next view to bind to table. But am not getting the value in the table display.
Please find the code,
oModel.callFunction("Get_Component_Details",
"GET", {
ProductOrd: prodNumber.value,
Component: Comp.value
},
null,
function(oData, oResponse){
if (oData.results instanceof Array && oData.results.length > 0) {
self.setComponentDetails(self, oData);
}
jQuery.sap.require("sap.m.MessageToast");
sap.m.MessageToast.show("Continues to select the component selection...");
sap.ui.getCore().byId("idapp").to("idCompDetailsPage");
},
//call back function of success
function(oError){
sap.m.MessageBox.alert("Error");
}
);
},
setComponentDetails: function(self, results) {
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData(results);
// sap.ui.getCore().setModel(oModel, "compModel");
},
in my CompDetailsPage"view controller
onBeforeRendering: function() {
var compModel = sap.ui.getCore().getModel("compModel");
this.getView().setModel(compModel);
var oTable = this.byId("idComponentTable");
oTable.setModel(compModel);
},
View: am giving the path as like this. But it is not working.
mode="MultiSelect"
inset="false"
items="{
path: '/results' }">
any help on this?