File tree 8 files changed +63
-19
lines changed
8 files changed +63
-19
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ sap.ui.define([
12
12
*/
13
13
//display the "notFound" target without changing the hash
14
14
this . getRouter ( ) . getTargets ( ) . display ( "notFound" , {
15
- fromTarget : "home"
16
- } ) ;
17
-
15
+ fromTarget : "home"
16
+ } ) ;
17
+ } ,
18
+ onNavToEmployees : function ( ) {
19
+ this . getRouter ( ) . navTo ( "employeeList" ) ;
18
20
}
19
21
} ) ;
20
22
} ) ;
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
6
6
NotFound =Not Found
7
7
NotFound.text =Sorry, but the requested resource is not available.
8
8
NotFound.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
6
6
NotFound =Not Found
7
7
NotFound.text =Sorry, but the requested resource is not available.
8
8
NotFound.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 17
17
data-sap-ui-oninit ="module:com/mrb/UI5-Navigation-and-Routing/initMockServer "
18
18
data-sap-ui-compatVersion ="edge "
19
19
data-sap-ui-async ="true "
20
+ data-sap-ui-xx-bindingSyntax ="complex "
20
21
data-sap-ui-frameOptions ="trusted ">
21
22
</ script >
22
23
</ head >
Original file line number Diff line number Diff line change 15
15
"type" : " OData" ,
16
16
"settings" : {
17
17
"odataVersion" : " 2.0" ,
18
- "localUri" : " localService/metadata.xml"
18
+ "localUri" : " localService/metadata.xml"
19
19
}
20
20
}
21
21
}
22
22
},
23
-
24
23
"sap.ui" : {
25
24
"technology" : " UI5" ,
26
25
"icons" : {
37
36
"phone" : true
38
37
}
39
38
},
40
-
41
39
"sap.ui5" : {
42
40
"rootView" : {
43
41
"viewName" : " com.mrb.UI5-Navigation-and-Routing.view.App" ,
69
67
}
70
68
},
71
69
"resources" : {
72
- "css" : [{
73
- "uri" : " css/style.css"
74
- }]
70
+ "css" : [
71
+ {
72
+ "uri" : " css/style.css"
73
+ }
74
+ ]
75
75
},
76
76
"routing" : {
77
77
"config" : {
80
80
"viewPath" : " com.mrb.UI5-Navigation-and-Routing.view" ,
81
81
"controlId" : " app" ,
82
82
"controlAggregation" : " pages" ,
83
- "transition" : " slide" ,
83
+ "transition" : " slide" ,
84
84
"bypassed" : {
85
85
"target" : " notFound"
86
- },
86
+ },
87
87
"async" : true
88
88
},
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
+ ],
94
103
"targets" : {
95
104
"home" : {
96
105
"viewType" : " XML" ,
103
112
"viewId" : " notFound" ,
104
113
"viewName" : " NotFound" ,
105
114
"transition" : " show"
115
+ },
116
+ "employees" : {
117
+ "viewId" : " employeeList" ,
118
+ "viewPath" : " com.mrb.UI5-Navigation-and-Routing.view.employee" ,
119
+ "viewName" : " EmployeeList" ,
120
+ "viewLevel" : 2
106
121
}
107
122
}
108
123
}
109
124
}
110
- }
125
+ }
Original file line number Diff line number Diff line change 5
5
<Page title =" {i18n>homePageTitle}" class =" sapUiResponsiveContentPadding" >
6
6
<content >
7
7
<Button id =" displayNotFoundBtn" text =" {i18n>DisplayNotFound}" press =" .onDisplayNotFound" class =" sapUiTinyMarginEnd" />
8
+ <Button id =" employeeListBtn" text =" {i18n>ShowEmployeeList}" press =" .onNavToEmployees" class =" sapUiTinyMarginEnd" />
8
9
</content >
9
10
</Page >
10
11
</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