first commit
This commit is contained in:
10
webapp/controller/App.controller.js
Normal file
10
webapp/controller/App.controller.js
Normal file
@ -0,0 +1,10 @@
|
||||
sap.ui.define([
|
||||
"sap/ui/core/mvc/Controller"
|
||||
], (BaseController) => {
|
||||
"use strict";
|
||||
|
||||
return BaseController.extend("mvcapp00124.controller.App", {
|
||||
onInit() {
|
||||
}
|
||||
});
|
||||
});
|
30
webapp/controller/BaseController.js
Normal file
30
webapp/controller/BaseController.js
Normal file
@ -0,0 +1,30 @@
|
||||
sap.ui.define(
|
||||
["sap/ui/core/mvc/Controller", "sap/ui/core/routing/History"],
|
||||
/**
|
||||
* @param {typeof sap.ui.core.mvc.Controller} Controller
|
||||
*/
|
||||
function (Controller, History) {
|
||||
"use strict";
|
||||
|
||||
return Controller.extend("mvcapp00124.controller.BaseController", {
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
onInit: function () { },
|
||||
getRouter: function() {
|
||||
return sap.ui.core.UIComponent.getRouterFor(this);
|
||||
},
|
||||
onNavBack: function(oEvent) {
|
||||
var oHistory, sPreviousHash;
|
||||
oHistory = History.getInstance();
|
||||
sPreviousHash = oHistory.getPreviousHash();
|
||||
|
||||
if(sPreviousHash !== undefined) {
|
||||
window.history.go(-1);
|
||||
}else {
|
||||
this.getRouter().navTo("home", {}, {}, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
25
webapp/controller/Enter.controller.js
Normal file
25
webapp/controller/Enter.controller.js
Normal file
@ -0,0 +1,25 @@
|
||||
sap.ui.define(
|
||||
["mvcapp00124/controller/BaseController"],
|
||||
/**
|
||||
* @param {typeof sap.ui.core.mvc.Controller} Controller
|
||||
*/
|
||||
|
||||
function (Controller) {
|
||||
"use strict";
|
||||
|
||||
return Controller.extend("mvcapp00124.controller.Enter", {
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
onInit: function () { },
|
||||
|
||||
onPressNavTo: function(oEvent) {
|
||||
this.getRouter().navTo("flightList", {}, {}, false);
|
||||
},
|
||||
|
||||
onPressTargets: function(oEvent) {
|
||||
this.getRouter().getTargets().display("flightList");
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
25
webapp/controller/Main.controller.js
Normal file
25
webapp/controller/Main.controller.js
Normal file
@ -0,0 +1,25 @@
|
||||
sap.ui.define(
|
||||
["mvcapp00124/controller/BaseController"],
|
||||
/**
|
||||
* @param {typeof sap.ui.core.mvc.Controller} Controller
|
||||
*/
|
||||
|
||||
function (Controller) {
|
||||
"use strict";
|
||||
|
||||
return Controller.extend("mvcapp00124.controller.Main", {
|
||||
onInit: function () {
|
||||
// var oRootPath = jQuery.sap.getModulePath("mvcapp00124");
|
||||
|
||||
// var oModel = new sap.ui.model.json.JSONModel(
|
||||
// oRootPath + "/model/flights.json"
|
||||
// );
|
||||
// this.getView().setModel(oModel);
|
||||
},
|
||||
|
||||
handleLineItemPress: function () {
|
||||
alert("Line item passed.");
|
||||
},
|
||||
});
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user