SAP UI5: master-detail parameter passing issues
<p>I have some issues with passing parameters from master to detail page in a SplitApp. I use a local JSON file which is specified as a model in the manifest.json.</p>

<p>I can pass the Id of an Object, but in that case, I can't figure out, how to receive the corresponding element in the detail view, to bind it to the view.</p>

<p>I also tried to pass the path of the element, but in this case, the url doesn't change after I select a list item.</p>

<p>Any ideas, how I can display the details on the detail page?</p>

<p>manifest.json:</p>

<pre><code>...
    "models": {
            "items": {
                "type": "sap.ui.model.json.JSONModel",
                "uri": "model/items.json"
            }
        },
    "routing": {
            "config": {
                "controlId": "rootControl",
                "viewPath": "my.try.view",
                "viewType": "XML",
                "async": true
            },
            "routes" : [
                {
                    "pattern" : "",
                    "name" : "master",
                    "target" : ["detail", "master"]
                },
                {
                    "pattern": "detail/{Id}",
                    "name":"detail",
                    "target": ["master", "detail"]
                }
            ],
            "targets" : {
                "master" : {
                "viewName" : "Master",
                "controlAggregation" : "masterPages"
                },
                "detail" : {
                    "viewName" : "Detail",
                    "controlAggregation" : "detailPages"
                }
            }
        }...
</code></pre>

<p>Master.view.xml</p>

<pre><code>&lt;mvc:View controllerName="my.try.controller.Master" xmlns:semantic="sap.m.semantic" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"&gt;
    &lt;semantic:MasterPage title="Persons"&gt;
                    &lt;List id="idList" items="{items&gt;/item}" selectionChange="onItemPressed" mode="SingleSelectMaster"&gt;
                        &lt;items&gt;
                            &lt;ObjectListItem title="{item&gt;Date}"&gt;
                                &lt;firstStatus&gt;
                                    &lt;ObjectStatus text="{item&gt;Status}"/&gt;
                                &lt;/firstStatus&gt;
                            &lt;/ObjectListItem&gt;
                        &lt;/items&gt;
                    &lt;/List&gt;
        &lt;/semantic:MasterPage&gt;
&lt;/mvc:View&gt;
</code></pre>

<p>Master.controller.js</p>

<pre><code>sap.ui.define([
    "sap/ui/core/mvc/Controller",
    "sap/ui/model/json/JSONModel"
    ], function(Controller, JSONModel) {

        "use strict";

        return Controller.extend("my.try.controller.Master", {

        onInit: function() {
            this.oRouter = this.getOwnerComponent().getRouter();
        },

        onItemPressed: function(oEvent) {
        // When I try with the path, nothing happens. Only passing the Id works!?   
        //  var oItemID = oEvent.getParameter("listItem").getBindingContext("items").getPath().substr(1);
            var oItemID = oEvent.getParameter("listItem").getBindingContext("items").getProperty("Id");
            this.oRouter.navTo("detail", {
            Id: oItemID
            });
        }
        });
    });
</code></pre>

<p>Detail.view.xml</p>

<pre><code>&lt;mvc:View controllerName="my.try.controller.Detail" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:semantic="sap.m.semantic"&gt;
    &lt;semantic:DetailPage title="Detail"&gt;
        &lt;ObjectHeader title="{ItemName}"/&gt;
    &lt;/semantic:DetailPage&gt;
&lt;/mvc:View&gt;
</code></pre>

<p>Detail.controller.js</p>

<pre><code>    sap.ui.define([
        "sap/ui/core/mvc/Controller"
        ], function(Controller) {

            "use strict";

            return Controller.extend("my.try.controller.Detail", {

            onInit: function() {
                this.oRouter = this.getOwnerComponent().getRouter();
                this.oRouter.getRoute("detail").attachPatternMatched(this._onDetailRouteHit, this);
            },

            _onDetailRouteHit: function(oEvent) {

                var sID = oEvent.getParameter("arguments").Id;
//The parameter is passed
                alert(sID);

//This doesn't work. How can I do this withou having a service?
                this.getView().getModel().metadataLoaded().then(function() {
                    var sObjectPath = this.getView().getModel().createKey("ItemSet", {
                        Id : sID
                    });
                    this.getView().bindElement({
                        path: "/" + sObjectPath
                    });
                }.bind(this));
            }   
        });
    });
</code></pre>