on 03-25-2022 9:59 PM
Hi,
I have a Fiori Elements ListReport/ObjectPage app and want to extend the controller of the ObjectPage.
Hence I added this to the manifest.json
"sap.ui5": {
...
"extends": {
"extensions": {
"sap.ui.controllerExtensions": {
"sap.suite.ui.generic.template.ObjectPage.view.Details": {
"controllerName": "de.tammenit.portal.ui.stammdaten.ext.Custom"
}
}
}
}
...
}
In folder "webapp/ext" I created a file "Custom.controller.js" with this content
sap.ui.define([], function() {
"use strict";
return {
onInit : function () {
console.log("samples.components.ext.customer.CustomMain - onInit");
},
doSomething: function() {
alert("this is a customer action");
}
}
});
When I run the application I would expect that my custom controller is merged into the ObjectPage.view.Details controller.
But my controller is not loaded and hence the onInit method is never called.
I also tried the "Controller Extension" approach described here: https://sapui5.hana.ondemand.com/#/topic/21515f09c0324218bb705b27407f5d61.html with no success.
Any suggestions?
Thanks Helmut
Hi,
probably it is too late, but I have had a discussion with the colleague. He showed me that the controller extension might not work with typed components, and you have to use sap.ui.controller to extend the existing controller. You can give it a try (yes, I know that you asked this question in April).
Meanwhile, it seems that you can use typed components, but your controller should be created in a different way (using sap.ui.core.mvc.ControllerExtension): https://sapui5.hana.ondemand.com/sdk/#/topic/c264d66d6e3c4104818bc52c174a000c (this is an original help article, but it points to another chapter that you might find it helpful: https://sapui5.hana.ondemand.com/sdk/#/topic/21515f09c0324218bb705b27407f5d61.html)
Kind regards,
Vlad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
72 | |
8 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.