Skip to Content

How to add new view in extended fiori leave request application and navigate to the view

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Jan 09 at 11:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 14 at 06:33 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 14 at 06:37 AM

    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

    Add comment
    10|10000 characters needed characters exceeded