From d747ffee73852a4bbde490ca89e9bec3649b3e48 Mon Sep 17 00:00:00 2001 From: Marco Beier Date: Wed, 8 Apr 2020 19:35:20 +0200 Subject: [PATCH] Added everything for Step 15: Reuse an Existing Route --- .../EmployeeOverviewContent.controller.js | 12 ++++- .../overview/EmployeeOverviewContent.view.xml | 46 +++++++++++++------ 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/webapp/controller/employee/overview/EmployeeOverviewContent.controller.js b/webapp/controller/employee/overview/EmployeeOverviewContent.controller.js index b79cafa..6cea9cd 100644 --- a/webapp/controller/employee/overview/EmployeeOverviewContent.controller.js +++ b/webapp/controller/employee/overview/EmployeeOverviewContent.controller.js @@ -173,8 +173,18 @@ sap.ui.define([ // Note: no input validation is implemented here this._oVSD.setSelectedSortItem(sSortField); this._oVSD.setSortDescending(bSortDescending); + }, + onItemPressed: function (oEvent) { + var oItem, oCtx; + oItem = oEvent.getParameter("listItem"); + oCtx = oItem.getBindingContext(); + this.getRouter().navTo("employeeResume",{ + employeeId : oCtx.getProperty("EmployeeID"), + "?query": { + tab: "Info" + } + }); } - }); }); diff --git a/webapp/view/employee/overview/EmployeeOverviewContent.view.xml b/webapp/view/employee/overview/EmployeeOverviewContent.view.xml index 82c2545..eb40d89 100644 --- a/webapp/view/employee/overview/EmployeeOverviewContent.view.xml +++ b/webapp/view/employee/overview/EmployeeOverviewContent.view.xml @@ -1,9 +1,7 @@ - - +
@@ -13,18 +11,36 @@ </Toolbar> </headerToolbar> <columns> - <Column id="employeeIDCol"><Text text="{i18n>EmployeeID}"/></Column> - <Column id="firstNameCol" demandPopin="true"><Text text="{i18n>formFirstName}"/></Column> - <Column id="lastNameCol" demandPopin="true"><Text text="{i18n>formLastName}"/></Column> - <Column id="addressCol" minScreenWidth="Tablet" demandPopin="true"><Text text="{i18n>formAddress}"/></Column> - <Column id="cityCol" minScreenWidth="Tablet" demandPopin="true"><Text text="{i18n>formCity}"/></Column> - <Column id="regionCol" minScreenWidth="Tablet" demandPopin="true"><Text text="{i18n>Region}"/></Column> - <Column id="postalCodeCol" minScreenWidth="Tablet" demandPopin="true"><Text text="{i18n>formPostalCode}"/></Column> - <Column id="countryCol" minScreenWidth="Tablet" demandPopin="true"><Text text="{i18n>formCountry}"/></Column> - <Column id="homePhoneCol" minScreenWidth="Tablet" demandPopin="true" hAlign="Right"><Text text="{i18n>Phone}"/></Column> + <Column id="employeeIDCol"> + <Text text="{i18n>EmployeeID}"/> + </Column> + <Column id="firstNameCol" demandPopin="true"> + <Text text="{i18n>formFirstName}"/> + </Column> + <Column id="lastNameCol" demandPopin="true"> + <Text text="{i18n>formLastName}"/> + </Column> + <Column id="addressCol" minScreenWidth="Tablet" demandPopin="true"> + <Text text="{i18n>formAddress}"/> + </Column> + <Column id="cityCol" minScreenWidth="Tablet" demandPopin="true"> + <Text text="{i18n>formCity}"/> + </Column> + <Column id="regionCol" minScreenWidth="Tablet" demandPopin="true"> + <Text text="{i18n>Region}"/> + </Column> + <Column id="postalCodeCol" minScreenWidth="Tablet" demandPopin="true"> + <Text text="{i18n>formPostalCode}"/> + </Column> + <Column id="countryCol" minScreenWidth="Tablet" demandPopin="true"> + <Text text="{i18n>formCountry}"/> + </Column> + <Column id="homePhoneCol" minScreenWidth="Tablet" demandPopin="true" hAlign="Right"> + <Text text="{i18n>Phone}"/> + </Column> </columns> <items> - <ColumnListItem> + <ColumnListItem type="Active"> <cells> <Text text="{EmployeeID}"/> <Text text="{FirstName}"/>