Hi Dennis,
Model looks like this:
{ "id":7,"company":"HECO","emp_last_name":"SAFETY DIVISION","emp_first_name":"","category":"EMERGENCY","department":"SERIOUS INJURIES","call_tree":"N/A","division":"N/A","group":"N/A","position":"N/A","last_updated":"2015-07-30T17:01:18.413-10:00","icl_phone_number":[ { "id":7,"phone":"(808) 123-4567","type":1,"person":7,"icl_phone_type":{ "id":1,"type":"business" } } ],"icl_attachments":[ ] },{ "id":8,"company":"HECO","emp_last_name":"SAFETY DIVISION","emp_first_name":"","category":"EMERGENCY","department":"SERIOUS INJURIES","call_tree":"N/A","division":"N/A","group":"N/A","position":"N/A","last_updated":"2015-07-30T17:01:18.413-10:00","icl_phone_number":[ { "id":8,"phone":"(808) 321-1231","type":1,"person":8,"icl_phone_type":{ "id":1,"type":"business" } } ],"icl_attachments":[ ] },{ "id":9,"company":"HECO","emp_last_name":"DOE","emp_first_name":"JOHN","category":"PERSON","department":"ITS","call_tree":"CC-ABC-3","division":"CC","group":"ABC","position":"N/A","last_updated":"2015-07-30T17:01:18.413-10:00","icl_phone_number":[ { "id":9,"phone":"(808) 134-5792","type":1,"person":9,"icl_phone_type":{ "id":1,"type":"business" } },{ "id":234,"phone":"(808) 213-4657","type":2,"person":9,"icl_phone_type":{ "id":2,"type":"cell" } },{ "id":909,"phone":"(808) 234-","type":5,"person":9,"icl_phone_type":{ "id":5,"type":"residence" } } ],"icl_attachments":[ ] }
I have a master.controller that allows a person to be selected from list and navigates to detail view based on following:
onListSelect: function(oEvent){ var oBindingContext = oEvent.getParameter("listItem").getBindingContext(); var viewId = oBindingContext.sPath; viewId = viewId.replace(/\//g,"_"); sap.ui.getCore().getEventBus().publish("nav", "to", { viewName: "view.contactsDetail", viewId: "Detail" + viewId, data: { bindingContext: oBindingContext } }); },
Detail view sets context like so:
onBeforeFirstShow: function (oEvent) { if (oEvent.data.bindingContext) { this.getView().setBindingContext(oEvent.data.bindingContext); } },
The detail view is set to how it was defined above in the original post. Let me know if that clears things up.
Thanks!
DJ