Now I tried following code which looks meaningful to me. But still Detail view is not displaying the System, Document and Reference details. Data binding is not working correctly.
handleListSelect : function (evt) {
var context = evt.getParameter("listItem").getBindingContext();
// alert("context.getPath(): " + context.getPath());
var oODataModel = this.getView().getModel("ODataModel");
var newContext = null;
var oObject = this.getView().getModel().getProperty(context.getPath());
var sPath = "/DealCollection('" + oObject.DealId + "')";
// alert("sPath: " + sPath);
oODataModel.read(sPath, null, {"$expand":"SystemCollection,DocumentCollection,ReferenceCollection"}, false, function(oData, oResponse){
var model = new sap.ui.model.json.JSONModel({SystemCollection:oData.SystemCollection.results, DocumentCollection:oData.DocumentCollection.results, ReferenceCollection:oData.ReferenceCollection.results});
newContext = new sap.ui.model.Context(model, context.getPath());
// newContext = new sap.ui.model.Context(model, sPath); // tried this also
});
this.nav.to("Detail", newContext);
},
<Tableid="idOverview"headerText="Installed Base Overview" items="{SystemCollection}">
Any suggestion what is wrong with above code? Why detail view not displaying the data?
Regards,
Vikram