diff --git a/webapp/controller/BaseController.js b/webapp/controller/BaseController.js index c1b5e76..9a0a0c2 100644 --- a/webapp/controller/BaseController.js +++ b/webapp/controller/BaseController.js @@ -1,6 +1,7 @@ sap.ui.define([ - "sap/ui/core/mvc/Controller" -], function (Controller) { + "sap/ui/core/mvc/Controller", + "sap/ui/core/UIComponent" +], function (Controller, UIComponent) { "use strict"; return Controller.extend("ui5.challenge.controller.BaseController", { @@ -9,9 +10,6 @@ sap.ui.define([ }, getRouter: function () { return UIComponent.getRouterFor(this); - }, - onPress: function () { - } }); }); diff --git a/webapp/controller/Detail.controller.js b/webapp/controller/Detail.controller.js new file mode 100644 index 0000000..2282029 --- /dev/null +++ b/webapp/controller/Detail.controller.js @@ -0,0 +1,16 @@ +sap.ui.define([ + "./BaseController", + "sap/m/Dialog" +], function (BaseController, Dialog) { + "use strict"; + + return BaseController.extend("ui5.challenge.controller.Detail", { + onDialog: function () { + if (!this._dialog) { + this._dialog = new Dialog({ id: 'myDialog' }) + this.getView().addDependent(this._dialog) + } + this._dialog.open() + } + }); +}); diff --git a/webapp/controller/Main.controller.js b/webapp/controller/Main.controller.js new file mode 100644 index 0000000..e52a80b --- /dev/null +++ b/webapp/controller/Main.controller.js @@ -0,0 +1,11 @@ +sap.ui.define([ + "./BaseController" +], function (BaseController) { + "use strict"; + + return BaseController.extend("ui5.challenge.controller.Main", { + onNavigate: function () { + this.getRouter().navTo('detail') + } + }); +}); diff --git a/webapp/i18n/i18n.properties b/webapp/i18n/i18n.properties index e69de29..09142bd 100644 --- a/webapp/i18n/i18n.properties +++ b/webapp/i18n/i18n.properties @@ -0,0 +1,4 @@ +appTitle=ui5-challenge +appDescription=ui5-challenge +mainTitleText=wdi5 rocks +detailTitleText=and ui5 too ! diff --git a/webapp/index.html b/webapp/index.html index 01c1bb6..f3ea286 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -1,7 +1,7 @@
-