on 01-09-2019 9:26 AM
Hi Experts,
We have extended the standard leave request Fiori application.
When I try to add new view and navigate using routes, I'm not able to do so.
Below is the error message from Console.
"Control with ID Application could not be found - EventProvider sap.m.routing.Target"
Could you please help in achieving the same.
We have extended leave request v2 and created new 'z' bsp application.
Thanks,
Vijay
Hi Mahesh,
Please find below code. "declaration" is the second view name.
Controller.js
handleDeclaration: function (oEvent) {
/this.oRouter.navTo("declaration", {});
var sUrl = "#" + this.getOwnerComponent().getRouter().getURL("declaration");
this.byId("idDeclarationLink").setHref(sUrl);
this.getOwnerComponent().getRouter().navTo("declaration");
}
Component.js
hcm.myleaverequest.Component.extend("hcm.myleaverequest.zhcm_lrq_cre.Component", {
metadata: {
version: "1.0",
includes: ["css/style.css"],
config: {
"sap.ca.i18Nconfigs": {
"bundleName": "hcm.myleaverequest.zhcm_lrq_cre.i18n.i18n"
},
},
customizing: {
"sap.ui.viewReplacements": {
"hcm.myleaverequest.view.S1": {
viewName: "hcm.myleaverequest.zhcm_lrq_cre.view.S1Custom",
type: "XML",
},
},
"sap.ui.controllerExtensions": {
"hcm.myleaverequest.view.S6B": {
controllerName: "hcm.myleaverequest.zhcm_lrq_cre.view.S6BCustom",
},
"hcm.myleaverequest.view.S1": {
controllerName: "hcm.myleaverequest.zhcm_lrq_cre.view.S1Custom",
},
"hcm.myleaverequest.view.S1-dbg": {
controllerName: "hcm.myleaverequest.zhcm_lrq_cre.view.S1-dbgCustom",
}
}
}
},
init: function () {
hcm.myleaverequest.Component.prototype.init.apply(this, arguments);
// Parse the current url and display the targets of the route that matches the hash
// this.getRouter().getTargets().addTarget("declarationTarget", {
// viewName: "Declaration",
// viewPath: "hcm.myleaverequest.zhcm_lrq_cre.view"
// });
this.getRouter().addRoute({
name: "declaration",
pattern: "declaration",
targetAggregation: "pages",
targetControl: "Application",
view: "Declaration",
viewLevel: 2,
viewPath: "hcm.myleaverequest.zhcm_lrq_cre.view"
});
this.getRouter().initialize();
}
});
Awaiting your response.
Thanks,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shree Krishan,
Thanks for your reply. I have tried the solution in the link.
But still it is not working for me.
Please note that we are using the V2 version of leave request.
Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijayaraghavan M,
I hope this link might help you
Error : Control with ID App could not be found - EventProvider sap.m.routing.Target
If the problem still persists let me know.
Thanks and Regards
Shree Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.