cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAPUI5 Error: adding element with duplicate id

Former Member
39,338

Hello Experts,

I've got a problem and I'm scathing my head for a while. I have two views in an SAPUI5 simple template app I created. Simple with nothing but couple of buttons on them and I'm navigating from View1 to View2 just fine using routing and I'm testing in run as FLP Sandbox. While going back to View1 using routing navigation I get an error "Error: adding element with duplicate id" for some control "application-Test-url-component---List". Just to make it clear I do put in the destroy method in the component.js like it is mentioned here https://archive.sap.com/discussions/thread/3730983

and I do tried destroying view onExit.

Any help would be appreciated.

View Entire Topic
flotxi
Participant

Can you check your rootView id in your manifest.json :

	"sap.ui5": {
		"rootView": {
			"viewName": "atsp.ProjPlannerPr.view.App",
			"type": "XML",
			"async": true,
			"id": "app"
		}

Make sure it has the same value as the id of you Main View:

<mvc:View controllerName="my.view.controller.Main" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" >
	<App id="app">
		<pages>
haemma83
Active Participant
0 Likes

Thanks man. You saved me know hours of my life!