From 1e1ca9ef85bd675d7c63f124d9c345da88e62744 Mon Sep 17 00:00:00 2001 From: Yavor Ivanov Date: Thu, 8 Jun 2017 15:56:56 +0300 Subject: [PATCH] Add detail pages to FlexibleColumnLayout and enable routing --- webapp/controller/Master.controller.js | 12 ++++++++++++ webapp/view/Detail.view.xml | 2 +- webapp/view/DetailDetail.view.xml | 2 +- webapp/view/Master.view.xml | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/webapp/controller/Master.controller.js b/webapp/controller/Master.controller.js index bcd52ea..eefffcc 100644 --- a/webapp/controller/Master.controller.js +++ b/webapp/controller/Master.controller.js @@ -101,6 +101,18 @@ sap.ui.define([ }, onToggleFooter: function () { this.getPage().setShowFooter(!this.getPage().getShowFooter()); + }, + handleItemPress: function (oEvent) { + var sId = oEvent.getParameter("id"), + oSelectedItem = sap.ui.getCore().byId(sId), + oModel = oSelectedItem.getModel(), + sPath = oSelectedItem.getBindingContextPath(), + oData = oModel.getProperty(sPath); + + this.getRouter().navTo("detailName", {"detail-item": oData.ProductId}); + }, + getRouter: function () { + return sap.ui.core.UIComponent.getRouterFor(this); } }); }); diff --git a/webapp/view/Detail.view.xml b/webapp/view/Detail.view.xml index 3bf032e..10bb205 100644 --- a/webapp/view/Detail.view.xml +++ b/webapp/view/Detail.view.xml @@ -3,5 +3,5 @@ xmlns="sap.m" displayBlock="true" height="100%"> -