cancel
Showing results for 
Search instead for 
Did you mean: 

How to close an app inside another app in component container approach with openUI5

former_member187007
Active Participant
0 Kudos
529

Hello SCN friends.

I'm trying to create a menu in openui5 like a Fiori Launchpad but deployed in a apache server, that's why I can't use Fiori launchpad, so I opted for using component container to host my child app when the user clicks on a menu option or tile, so I have one view for each app, inside each view I put a component container where I load my child app, this is on the onInit method, like this:

this.byId("pageCalcExtrac").addContent( new sap.ui.core.ComponentContainer({
				 		autoPrefixId : true,
					 	settings : { id: "childComponent5"},
				 		height : "100%",
				 	 	manifest : true,
				 	 	async : true,
				 	  	lifecycle : "Container",
				 	  	usage : "reuseAnotherComponent"
				 	 }));

When I close the child app I need to destroy or unload it, but when I get back to the menu (custom launchpad) and enter again the child app, the app is already loaded in memory, I would like to have it loading again from scratch, the same behavior that a Fiori Launchpad does it. Somebody can tell me how can I destroy the child app when I get back to the launchpad?.

Best regards.

Jhon Jairo

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion
0 Kudos

call removecontent when you navigate back.

former_member187007
Active Participant
0 Kudos

Thanks Jun, this was what I did: instead of doing it inside the navigate back button I had to handle the event onAfterHide and onAfterShow in the parent view to destroy and create the content of the child app, now it works as desire, when I'm in my child app, simply I do the window.history.go(-1) and returns to the menu view triggering the event onAfterHide of the parent view (pageCalcExtrac) destroying the content, when I enter again the child app, the parent view triggers the onAfterShow event and the child app loads from the scratch. I'm going to keep testing because this was something that I found doing some google search I'm not sure if this is the right approach but it works so far. The events onAfterHide and onAfterShow I put them inside an addEventDelegate method call inside the onInit method of the parent view.

Thanks to all.

Jhon Jairo.