Skip to Content

Reuse View 2 of App 2 in View 1 of App1

Hi All,

I have 2 applications in my fiori launchpad:

App1 which has View 1

App2 which has View 1 & View 2.

In the View1 of App1 I have Icon Tab Bar and on the click of the Icon Tab I want to load the View 2 of App2. Meaning I want to embed/reuse the same xml view of App2 in App1,

Please note:

So far, I have tried 2 approaches:

  1. var oComp = sap.ui.getCore().createComponent( {

name : "hc.pe.manageaccounts",

id : "Comp4",

url : "/hcpemanageaccounts",
componentData : {

"targetViewName" : "CreateUser"

}

});

this.oCompContainer = new sap.ui.core.ComponentContainer("oCompEdit", {

component: oComp,

propagateModel: true,

height: "50%"

});

this.oCompContainer.placeAt(this.getView().byId("id"));

https://archive.sap.com/discussions/message/16627714#16627714

This approach, give me the component instance.

2. Using the "resourceRoots", in the manifest.json: THis approach only searches the local resources folder of the current application.

3. I also tried, registerResourcePath and jquery.sap.require,but could not get the solution.

Any help will be highly appreciated.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Oct 20, 2016 at 01:51 PM

    Hi Priya,

    I have done something like this in some prototyping and the only thing I had to do was do call registerModulePath("some name", "server path") in the Component.js file where I want to add the view from the other application. Then in the init function of the controller I create the component and place it into the view like so:

    var component = sap.ui.getCore().createComponent({
                    name: "some name"
                });
                var oCompCont1 = new sap.ui.core.ComponentContainer({component: component});
                oCompCont1.placeAt(view.byId("somePage"));

    Regards,

    Ryan Crosby

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.