Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
12 changes: 12 additions & 0 deletions webapp/controller/App.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sap.ui.define([
"ui5/challenge/controller/BaseController"
], function (
Controller
) {
"use strict";

return Controller.extend("ui5.challenge.controller.App", {
onInit: function () {
}
});
});
16 changes: 16 additions & 0 deletions webapp/controller/BaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ sap.ui.define([
"use strict";

return Controller.extend("ui5.challenge.controller.BaseController", {
/**
* @override
*/
onInit: function () {
console.log("Base init");
},

/**
* Convenience method for getting the resource bundle.
* @public
* @returns {sap.ui.model.resource.ResourceModel} the resourceModel of the component
*/
getResourceBundle: function () {
return this.getOwnerComponent().getModel("i18n").getResourceBundle();
},

navTo: function (psTarget, pmParameters, pbReplace) {
this.getRouter().navTo(psTarget, pmParameters, pbReplace);
},
Expand Down
23 changes: 23 additions & 0 deletions webapp/controller/Main.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
sap.ui.define([
"ui5/challenge/controller/BaseController",
"sap/ui/model/json/JSONModel",
], function (
Controller,
JSONModel
) {
"use strict";

return Controller.extend("ui5.challenge.controller.Main", {
/**
* @override
*/
onInit: function () {
var oModel = new JSONModel(sap.ui.require.toUrl("ui5/challenge/mockdata/products.json"));
this.getView().setModel(oModel);
},

onButtonPress: function (oEvent) {
alert("Pressed");
}
});
});
4 changes: 4 additions & 0 deletions webapp/i18n/i18n.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
appTitle=ui5-challenge
appDescription=My fulfillment of ui5-challenge tests.

list.headerText=Products
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>
21 changes: 19 additions & 2 deletions webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"sap.app": {
"id": "ui5.challenge",
"type": "application",
"i18n": "i18n/i18n.properties",
"applicationVersion": {
"version": "0.0.1"
},
Expand Down Expand Up @@ -47,8 +48,24 @@
"controlId": "app",
"clearControlAggregation": false
},
"routes": [],
"targets": {}
"routes": [
{
"pattern": "",
"name": "RouteMain",
"target": [
"TargetMain"
]
}
],
"targets": {
"TargetMain": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewName": "Main",
"viewId": "main"
}
}
},
"rootView": {
"viewName": "ui5.challenge.view.App",
Expand Down
Loading