I'm currently working on my first SAP Fiori App. In SAP WebIDE I created a project from template using Master Detail and connected it to my oData Service.
If I run the unmodified App, everything works except that no data gets loaded on Detail View because the oData Service expects 2 parameters to get a unique record.
Now the problem is, if I modify the app to use 2 parameters and navigate to the Detail View, the Detail View loads, but doesn't even hit the oData Service. (No $batch Request in Chrome Dev Tools)
Modifications in manifest.json
{
"pattern": "JOBSSet/{Jobname}/{Jobcount}",
"name": "object",
"target": [
"master",
"object"
]
}
Modification of Master Controller:
_showDetail : function (oItem) {
var bReplace = !Device.system.phone;
// set the layout property of FCL control to show two columns
this.getModel("appView").setProperty("/layout", "TwoColumnsMidExpanded");
this.getRouter().navTo("object", {
Jobname : encodeURIComponent(oItem.getBindingContext().getProperty("Jobname")),
Jobcount : oItem.getBindingContext().getProperty("Jobcount")
}, bReplace);
}
Modification of Detail Controller:
_onObjectMatched : function (oEvent) {
var sJobname = decodeURIComponent(oEvent.getParameter("arguments").Jobname);
var sJobcount = oEvent.getParameter("arguments").Jobcount;
this.getModel("appView").setProperty("/layout", "TwoColumnsMidExpanded");
this.getModel().metadataLoaded().then( function() {
var sObjectPath = this.getModel().createKey("JOBSSet", {
Jobname : sJobname,
Jobcount : sJobcount
});
this._bindView("/" + sObjectPath);
}.bind(this));
}