I am developing an application by using SAPUI5, Web IDE. Is it possible to create a controller without a view? Because I need a custom controller to process the logic of application before submit it to the server.
I try to create a controller without with view. But it return me with error.
The following is my sample code.
/*global location*/
sap.ui.define([
"product/controller/BaseController",
"sap/ui/model/json/JSONModel",
"sap/ui/core/routing/History",
"product/model/formatter"
], function(BaseController, JSONModel, History, formatter) {
onInit: function() {
sap.ui.getCore().getEventBus().subscribe(
"SomeChannel",
"SomeEvent",
this.someFunctionOfTheFirstController,
this
);
}
processLogic: function (sChannelId, sEventId, sData) {
console.log(
"Function of the first controller " + sData
);
}
});
Any solution how can I fix it and to create a controller and method without a view.
definecan return a function or an object, it doesn't need to extend the controller. Return a function you can use to subscribe to the event bus and use it in the other controller? - Jorg