Skip to Content

SAPUI5 Reuse Application - Routing not working

Hi,

i've checked various blogs and discussions on reusability of UIComponents.

I have created two Apps, both running fine when running standalone. Both are using routing. The router is initialized in the init function of the UIComponent.

I have the requirement that the second app is embedded into the first app. I did the embedding with the ComponentContainer.

var oComponent = sap.ui.getCore().createComponent({
    name: "com.abcd.reuse.ZSD_DETAIL",
    settings: {
	componentData: {
	     startupParameters: oStartupParameters
	}
    }
});
				
new sap.ui.core.ComponentContainer({
    component: oComponent
}).placeAt("content");

In the second view i have a rootView hosting the empty sap.m.App. The default route is pointing to a view named Main.view.xml with a corresponding controller. My problem is, that the default view is not loaded from the embedded App. It seems that it is a problem with the router, but I am not sure. Maybe i did something wrong when embedding the app. But if i remove routing from the second app an add a page directly to the rootView it shows up as expected.

Do you have any idea on this? Am i missing something ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 27, 2017 at 05:12 PM

    just a thought...when you say two Applications I assume that you have two manifest.json files...and when the component is loaded corresponding manifest.json file is loaded.

    Check this blog for reusing components https://blogs.sap.com/2017/04/05/sapui5-how-to-reuse-parts-of-a-sapui5-application-in-othermultiple-sapui5-applications/

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      i've tried to follow this blog, everything works when no routing is used. I am running on 7.5 ABAP with the latest SPS and the latest UI5 Version.

      Br,

      Martin

  • Jul 29, 2017 at 12:37 AM

    do you have #*** in the url when the second app is embedded?

    your second is app also trying to respond to that #*** but it is not suppose to ....which cause the issue.

    Add comment
    10|10000 characters needed characters exceeded