Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week2 #30

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
.ssh
Empty file added webapp/Component-preload.js
Empty file.
10 changes: 3 additions & 7 deletions webapp/controller/BaseController.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function (Controller) {
sap.ui.define(["sap/ui/core/mvc/Controller","sap/ui/core/UIComponent"], function (Controller,UIComponent) {
"use strict";

return Controller.extend("ui5.challenge.controller.BaseController", {
navTo: function (psTarget, pmParameters, pbReplace) {
this.getRouter().navTo(psTarget, pmParameters, pbReplace);
const r = this.getRouter()
r.navTo(psTarget, pmParameters, pbReplace);
},
getRouter: function () {
return UIComponent.getRouterFor(this);
},
onPress: function () {

}
});
});
9 changes: 9 additions & 0 deletions webapp/controller/MainController.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sap.ui.define([ "./BaseController" ], function (Controller) {
"use strict";

return Controller.extend("ui5.challenge.controller.MainController", {
onPress: function () {
this.navTo("Detail")
}
});
});
3 changes: 3 additions & 0 deletions webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
appTitle=ui5-challenge
appDescription=UI5 challenge app
mainTitleText=wdi5 rocks
2 changes: 2 additions & 0 deletions webapp/i18n/i18n_en.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appTitle=ui5-challenge
appDescription=UI5 challenge app
2 changes: 2 additions & 0 deletions webapp/i18n/i18n_en_GB.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
appTitle=ui5-challenge
appDescription=UI5 challenge app
29 changes: 10 additions & 19 deletions webapp/index.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
<!DOCTYPE html>
<html>

<head>
<title>title</title>
<title>ui5-challenge</title>

<script
id="sap-ui-bootstrap"
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_horizon"
data-sap-ui-resourceroots='{
<script id="sap-ui-bootstrap" src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_horizon" data-sap-ui-resourceroots='{
"ui5.challenge": "./"
}'
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-frameOptions="trusted"
></script>
}' data-sap-ui-oninit="module:sap/ui/core/ComponentSupport" data-sap-ui-compatVersion="edge"
data-sap-ui-async="true" data-sap-ui-frameOptions="trusted"></script>
</head>

<body class="sapUiBody sapUiSizeCompact" id="content">
<div
data-sap-ui-component
data-name="ui5.challenge"
data-id="container"
data-settings='{"id" : "ui5.challenge"}'
data-handle-validation="true"
></div>
<div data-sap-ui-component data-name="ui5.challenge" data-id="container" data-settings='{"id" : "ui5.challenge"}'
data-handle-validation="true"></div>
</body>

</html>
24 changes: 22 additions & 2 deletions webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,28 @@
"controlId": "app",
"clearControlAggregation": false
},
"routes": [],
"targets": {}
"routes": [
{
"name": "default",
"pattern": "",
"target": "Main"
},
{
"name": "Detail",
"pattern": "RouteDetail",
"target": "Detail"
}
],
"targets": {
"Main": {
"viewId": "Main",
"viewName": "Main"
},
"Detail": {
"viewId": "Detail",
"viewName": "Detail"
}
}
},
"rootView": {
"viewName": "ui5.challenge.view.App",
Expand Down
3 changes: 3 additions & 0 deletions webapp/view/Detail.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
Detail
</mvc:View>
10 changes: 10 additions & 0 deletions webapp/view/Main.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<mvc:View xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m" controllerName="ui5.challenge.controller.MainController">
<Title id="title" text="{i18n>mainTitleText}" />
<Button text="Foo" id="mainButton" />
<Button text="Details" id="myControl" press=".onPress"/>
<List >
<StandardListItem title="1" />
<StandardListItem title="2" />
<StandardListItem title="3" />
</List>
</mvc:View>