HI,
Im developing webIDE plugin with UI, in the service I initiate the view .
In the UI I've button with press event which invoke my controller.(this is working)
My question is how should I call from the controller to the service.
I need to invoke some method inside the service from the controller
I didnt find any docs about it, any reference/example which show how can I call from
the controller to WebIDE service will be very helpful
Thanks,
Joerg
This is my plugin service
I need to call from the controller to fn1
define(["sap/watt/common/plugin/platform/service/ui/AbstractPart"], function(AbstractPart) { "use strict"; var Att = AbstractPart.extend("myplugin.service. MYPlugin", { init: function(val) { debugger; }, //this is the function which I need to call inside my controller fn1:function() { debugger; }, getContent: function() { var that = this; ... var oView = sap.ui.view({ viewName: "myplugin.view.test", type: sap.ui.core.mvc.ViewType.JS, name: "invoke", viewData: { service:that } }); .... //Here I return the service return Att;
This is my controller and I want to call to fn1 from it and I've the service object
sap.ui.controller("attplugin.control.att", { myservice: {}, setContext: function(service) { this.myservice = service; }, getContext: function() { return this.myservice; }, onInit: function(oView) { var oViewData = this.getView().getViewData(); //Here im getting the service object which I sent from the service when init the view this.setContext(oViewData.service); //Now want to call to fn1 inside the service how should I do that ?????