File tree Expand file tree Collapse file tree 8 files changed +63
-19
lines changed
Expand file tree Collapse file tree 8 files changed +63
-19
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ sap.ui.define([
1212 */
1313 //display the "notFound" target without changing the hash
1414 this . getRouter ( ) . getTargets ( ) . display ( "notFound" , {
15- fromTarget : "home"
16- } ) ;
17-
15+ fromTarget : "home"
16+ } ) ;
17+ } ,
18+ onNavToEmployees : function ( ) {
19+ this . getRouter ( ) . navTo ( "employeeList" ) ;
1820 }
1921 } ) ;
2022} ) ;
Original file line number Diff line number Diff line change 1+ sap . ui . define ( [
2+ "com/mrb/UI5-Navigation-and-Routing/controller/BaseController"
3+ ] , function ( BaseController ) {
4+ "use strict" ;
5+ return BaseController . extend ( "com.mrb.UI5-Navigation-and-Routing.controller.employee.EmployeeList" , { } ) ;
6+ } ) ;
Original file line number Diff line number Diff line change @@ -6,4 +6,7 @@ homePageTitle=Home
66NotFound =Not Found
77NotFound.text =Sorry, but the requested resource is not available.
88NotFound.description =Please check the URL and try again.
9- DisplayNotFound =Display Not Found
9+ DisplayNotFound =Display Not Found
10+ ShowEmployeeList =Show Employee List
11+ EmployeeList =Employee List
12+ ListOfAllEmployees =List of all employees
Original file line number Diff line number Diff line change @@ -6,4 +6,7 @@ homePageTitle=Home
66NotFound =Not Found
77NotFound.text =Sorry, but the requested resource is not available.
88NotFound.description =Please check the URL and try again.
9- DisplayNotFound =Display Not Found
9+ DisplayNotFound =Display Not Found
10+ ShowEmployeeList =Show Employee List
11+ EmployeeList =Employee List
12+ ListOfAllEmployees =List of all employees
Original file line number Diff line number Diff line change 1717 data-sap-ui-oninit ="module:com/mrb/UI5-Navigation-and-Routing/initMockServer "
1818 data-sap-ui-compatVersion ="edge "
1919 data-sap-ui-async ="true "
20+ data-sap-ui-xx-bindingSyntax ="complex "
2021 data-sap-ui-frameOptions ="trusted ">
2122 </ script >
2223 </ head >
Original file line number Diff line number Diff line change 1515 "type" : " OData" ,
1616 "settings" : {
1717 "odataVersion" : " 2.0" ,
18- "localUri" : " localService/metadata.xml"
18+ "localUri" : " localService/metadata.xml"
1919 }
2020 }
2121 }
2222 },
23-
2423 "sap.ui" : {
2524 "technology" : " UI5" ,
2625 "icons" : {
3736 "phone" : true
3837 }
3938 },
40-
4139 "sap.ui5" : {
4240 "rootView" : {
4341 "viewName" : " com.mrb.UI5-Navigation-and-Routing.view.App" ,
6967 }
7068 },
7169 "resources" : {
72- "css" : [{
73- "uri" : " css/style.css"
74- }]
70+ "css" : [
71+ {
72+ "uri" : " css/style.css"
73+ }
74+ ]
7575 },
7676 "routing" : {
7777 "config" : {
8080 "viewPath" : " com.mrb.UI5-Navigation-and-Routing.view" ,
8181 "controlId" : " app" ,
8282 "controlAggregation" : " pages" ,
83- "transition" : " slide" ,
83+ "transition" : " slide" ,
8484 "bypassed" : {
8585 "target" : " notFound"
86- },
86+ },
8787 "async" : true
8888 },
89- "routes" : [{
90- "name" : " appHome" ,
91- "pattern" : " " ,
92- "target" : [" home" ]
93- }],
89+ "routes" : [
90+ {
91+ "name" : " appHome" ,
92+ "pattern" : " " ,
93+ "target" : [
94+ " home"
95+ ]
96+ },
97+ {
98+ "name" : " employeeList" ,
99+ "pattern" : " employees" ,
100+ "target" : " employees"
101+ }
102+ ],
94103 "targets" : {
95104 "home" : {
96105 "viewType" : " XML" ,
103112 "viewId" : " notFound" ,
104113 "viewName" : " NotFound" ,
105114 "transition" : " show"
115+ },
116+ "employees" : {
117+ "viewId" : " employeeList" ,
118+ "viewPath" : " com.mrb.UI5-Navigation-and-Routing.view.employee" ,
119+ "viewName" : " EmployeeList" ,
120+ "viewLevel" : 2
106121 }
107122 }
108123 }
109124 }
110- }
125+ }
Original file line number Diff line number Diff line change 55 <Page title =" {i18n>homePageTitle}" class =" sapUiResponsiveContentPadding" >
66 <content >
77 <Button id =" displayNotFoundBtn" text =" {i18n>DisplayNotFound}" press =" .onDisplayNotFound" class =" sapUiTinyMarginEnd" />
8+ <Button id =" employeeListBtn" text =" {i18n>ShowEmployeeList}" press =" .onNavToEmployees" class =" sapUiTinyMarginEnd" />
89 </content >
910 </Page >
1011</mvc : View >
Original file line number Diff line number Diff line change 1+ <mvc : View controllerName =" com.mrb.UI5-Navigation-and-Routing.controller.employee.EmployeeList"
2+ xmlns =" sap.m"
3+ xmlns : mvc =" sap.ui.core.mvc" >
4+ <Page id =" employeeListPage" title =" {i18n>EmployeeList}" showNavButton =" true" navButtonPress =" .onNavBack" class =" sapUiResponsiveContentPadding" >
5+ <content >
6+ <List id =" employeeList" headerText =" {i18n>ListOfAllEmployees}" items =" {/Employees}" >
7+ <items >
8+ <StandardListItem title =" {FirstName} {LastName}" iconDensityAware =" false" iconInset =" false" />
9+ </items >
10+ </List >
11+ </content >
12+ </Page >
13+ </mvc : View >
You can’t perform that action at this time.
0 commit comments