<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SAPUI5 Error: adding element with duplicate id in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754355#M215744</link>
    <description>&lt;P&gt;Thank you Jinat, your solution worked for me too &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 08:46:03 GMT</pubDate>
    <dc:creator>ccalvom</dc:creator>
    <dc:date>2022-06-08T08:46:03Z</dc:date>
    <item>
      <title>SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaq-p/754323</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt;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 &lt;A href="https://archive.sap.com/discussions/thread/3730983" target="test_blank"&gt;https://archive.sap.com/discussions/thread/3730983&lt;/A&gt; &lt;/P&gt;
  &lt;P&gt;and I do tried destroying view onExit.&lt;/P&gt;
  &lt;P&gt;Any help would be appreciated. &lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 15:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaq-p/754323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T15:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754324#M215713</link>
      <description>&lt;P&gt;Do you have any control with the ID "List" and where are you creating it?&lt;/P&gt;&lt;P&gt;Pasting the code will be helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 15:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754324#M215713</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2019-02-26T15:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754325#M215714</link>
      <description>&lt;P&gt;Thanks for the reply Mahesh, My View Name is List and I'm thinking it is just trying to instantiate it again. Below is my List.controller.js&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; sap.ui.define(["sap/ui/core/mvc/Controller"], function (Controller) {
	"use strict";
	return Controller.extend("olin.shipment.OLIN_SHIPMENT_OUTPUT.controller.List", {
		onInit: function () {},
				onExit: function() {
				var oView	= this.getView();
			//this.getView().destroy();
				},
		/**
		 *@memberOf olin.shipment.OLIN_SHIPMENT_OUTPUT.controller.List
		 */
		onNavigate: function (oEvent) {
			//This code was generated by the layout editor.
			var oRouter = this.getOwnerComponent().getRouter();
			oRouter.navTo("Output", {
				objectId: "test"
			});
			//	this.getView().destroy();
		}
	});
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 15:57:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754325#M215714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T15:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754326#M215715</link>
      <description>&lt;P&gt;Also this is my Simple XML View.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;mvc:View xmlns:mvc="sap.ui.core.mvc" 
xmlns:core="sap.ui.core" 
xmlns:layout="sap.ui.layout" 
xmlns="sap.m" xmlns:f="sap.f" 
xmlns:fb="sap.ui.comp.filterbar"
xmlns:vm="sap.ui.comp.variants"
controllerName="olin.shipment.OLIN_SHIPMENT_OUTPUT.controller.List" height="100%"&amp;gt;


		&amp;lt;App id="app"&amp;gt;
			&amp;lt;pages&amp;gt;
				&amp;lt;Page id="page" title="{i18n&amp;gt;title}"&amp;gt;
					
					&amp;lt;content&amp;gt;
					
				&amp;lt;OverflowToolbar&amp;gt;
					&amp;lt;ToolbarSpacer/&amp;gt;
					&amp;lt;Button type="Accept" text="Accept" press="onNavigate"/&amp;gt;
					&amp;lt;Button type="Reject" text="Reject"/&amp;gt;
				&amp;lt;/OverflowToolbar&amp;gt;
			
	
					&amp;lt;/content&amp;gt;
				&amp;lt;/Page&amp;gt;
			&amp;lt;/pages&amp;gt;
		&amp;lt;/App&amp;gt;


&amp;lt;/mvc:View&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:01:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754326#M215715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T16:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754327#M215716</link>
      <description>&lt;P&gt;I would appreciate if you can shed some light. It is getting a bit a frustrating &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:02:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754327#M215716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T16:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754328#M215717</link>
      <description>&lt;P&gt;It seems like there are still some artefacts left from your old view when the Router tries to instantiate a new one.&lt;/P&gt;&lt;P&gt;Why do you want to destroy your view? Doesn't make any sense to me.&lt;/P&gt;&lt;P&gt;You should try to implement your requirements without destroying your view.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:15:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754328#M215717</guid>
      <dc:creator>former_member221786</dc:creator>
      <dc:date>2019-02-26T16:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754329#M215718</link>
      <description>&lt;P&gt; @&lt;A href="https://answers.sap.com/users/7022/sebastiankielhorn.html"&gt;Sebastian Kielhorn&lt;/A&gt; - I agree I do not want to and if you see I have it commented it out. It is there just beacuse I tried it and it is still not working. Desperation makes you do crazy things :). Any suggestions? &lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:20:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754329#M215718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T16:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754330#M215719</link>
      <description>&lt;P&gt;Ok sounds good so far &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How do you go back to your original view?&lt;BR /&gt;Do you do something like window.history.go(-1); or do you navigate forward?&lt;/P&gt;&lt;P&gt;Also where does the following code happen in your application?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;this.getRouter().initialize();&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 16:42:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754330#M215719</guid>
      <dc:creator>former_member221786</dc:creator>
      <dc:date>2019-02-26T16:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754331#M215720</link>
      <description>&lt;P&gt;This happens in Component.js file. Below is the code from that file for init and destroy.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;	init: function () {
			// call the base component's init function
			UIComponent.prototype.init.apply(this, arguments);


			// enable routing
			this.getRouter().initialize();


			// set the device model
			this.setModel(models.createDeviceModel(), "device");
		},
			destroy : function () {
				this._oErrorHandler.destroy();
				if (this.oRouteHandler) {


   this.oRouteHandler.destroy();


  }
				// call the base component's destroy function
				sap.ui.core.UIComponent.prototype.destroy.apply(this, arguments);
			},
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:00:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754331#M215720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T17:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754332#M215721</link>
      <description>&lt;P&gt;can you share your neo app file?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:00:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754332#M215721</guid>
      <dc:creator>carlos_venturo</dc:creator>
      <dc:date>2019-02-26T17:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754333#M215722</link>
      <description>&lt;P&gt;and I'm basically navigating forward. like you do for any other view.Below is my method that is calling routing.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;onNavigate: function (oEvent) {
				//This code was generated by the layout editor.
				var oRouter = this.getOwnerComponent().getRouter();
				oRouter.navTo("List", {
					objectId: "test",
					abc: "123"
				});
			}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:03:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754333#M215722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T17:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754334#M215723</link>
      <description>&lt;P&gt;   &lt;SPAN class="mention-scrubbed"&gt;carlos.venturo3&lt;/SPAN&gt; here is my neu.app.json file below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{
  "welcomeFile": "/webapp/index.html",
  "routes": [
    {
      "path": "/resources",
      "target": {
        "type": "service",
        "name": "sapui5",
        "entryPath": "/resources"
      },
      "description": "SAPUI5 Resources"
    },
    {
      "path": "/test-resources",
      "target": {
        "type": "service",
        "name": "sapui5",
        "entryPath": "/test-resources"
      },
      "description": "SAPUI5 Test Resources"
    }
  ],
  "sendWelcomeFileRedirect": true
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:07:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754334#M215723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T17:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754335#M215724</link>
      <description>&lt;P&gt;Just to emphasize I'm using SAPUI5 template for my template so unless I made a mistake somewhere in the few things I have added I think structure should be be fine for the app. thoughts?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 17:34:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754335#M215724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T17:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754336#M215725</link>
      <description>&lt;P&gt;I debugged and found on routing to "List" (view1) system is trying to create the view again in the code below. Any idea how can i prevent that or what I'm doing wrong?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;var sViewClass = getViewClassName(oView);
		view = createView(sViewClass, oView); // this is where the error occurs as view exists already 
		return view;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 18:25:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754336#M215725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T18:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754337#M215726</link>
      <description>&lt;P&gt;Guess what. I created a new app using SAPUI5 Template in WebIDE. Created a View a new View2 and did simple navigation from view1 to view2 works like a charm and soon as I did navigation back got the same error. Why? Anyone? Here is the error below..Is there a way I can kill/destroy view1?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Error: adding element with duplicate id 'application-Test-url-component---View1'&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Feb 2019 19:19:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754337#M215726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T19:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754338#M215727</link>
      <description>&lt;P&gt;I'm seriously using nothing but template and two buttons to navigate. What could possibly go wrong? &lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 19:31:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754338#M215727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-02-26T19:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754339#M215728</link>
      <description>&lt;P&gt;HI - having the same issue. Gonna try and "down" the version to see if that helps!&lt;/P&gt;&lt;P&gt;Anyone found a solution?&lt;/P&gt;&lt;P&gt;/Allan&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 08:13:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754339#M215728</guid>
      <dc:creator>allan_christensen3</dc:creator>
      <dc:date>2019-05-16T08:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754340#M215729</link>
      <description>&lt;P&gt;HI - having the same issue. Gonna try and "down" the version to see if that helps!&lt;/P&gt;&lt;P&gt;Anyone found a solution?&lt;/P&gt;&lt;P&gt;/Allan&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 08:13:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754340#M215729</guid>
      <dc:creator>allan_christensen3</dc:creator>
      <dc:date>2019-05-16T08:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754341#M215730</link>
      <description>&lt;P&gt;I am also facing same issue. Did anyone get solution?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 11:15:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754341#M215730</guid>
      <dc:creator>former_member612786</dc:creator>
      <dc:date>2019-06-12T11:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Error: adding element with duplicate id</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754342#M215731</link>
      <description>&lt;P&gt;No Ankit, Noone is given an answer yet. But I've found how you can fix it. Actually, I compared this to other standard Fiori templates and seems like they use a dummy app view and this SAPUI5 template doesn't and that app view acts as a container. &lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 13:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-error-adding-element-with-duplicate-id/qaa-p/754342#M215731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-06-13T13:49:31Z</dc:date>
    </item>
  </channel>
</rss>

