Skip to Content
author's profile photo Former Member
Former Member

Error - Adding element with duplicate id with Launching Custom UI5 app from Fiori launch Pad

Fellow Members - Custom UI5 application configured into the Fiori Launch Pad and able to launch successfully first time. However, when user click on "Home" button on the Custom Application to navigate back to launch pad and re-launch same application, application end up with error - "Adding element with duplicate id". Seem like some reason Controls don't get destroyed when application destroyed.

Was spent time looking into the issue and was end up with no luck.The error is simple and make sense but don't know the fix :-(

I am looking for thoughts & direction to fix the issue.

Happy Friday..

Tags edited by: Michael Appleby

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2015 at 11:17 AM

    Even I had come across same problem. I have noticed the SAPUI5 framework is not destroying the content and instances of the component container when we destroy using

    UIComponent.prototype.destroy.apply(this, arguments)"

    I have variant Management control on my page and destroying on its controller using this.destroy() did not destroy the variant Management control instance.

    So best option what I have tried is to remove id of the view. So that framework generates id for the view each time you move away from the page and come back. Hence it resolved duplicate Id issue and I was able to navigate as many times back and fro from launchpad to app.

    Note*:

    If the id for the view is specified in component.js or manifest.js you need to remove it.

    "targets": {

    "worklist": {

    "viewName": "Worklist",

    "viewId": "worklist", // Remove this line in the configuration

    "viewLevel": 1

    }

    }

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2014 at 05:58 PM

    I would need some more details from your CHROME or FF debug console. In your custom SAPUI5 app do not create the control with a specific ID and instead just leave it blank. Pls try that and let me know.

    thanks

    A

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Ashish!! Below is the error details captured from Developer Tools of Chrome browser. I willl try out your suggestion to have a Control with blank ID and keep you posted on the result.

      ******************************************************************************************************************

      1. 2014-08-29 13:28:22 adding element with duplicate id 'idViewRoot--idViewMaster--itemTrips'

      1. 2014-08-29 13:28:22 Error - Error: adding element with duplicate id 'idViewRoot--idViewMaster--itemTrips'

      1. 2014-08-29 13:28:23 Failure - Unable to start App

      ***********************************************************************************************************************

  • Posted on Oct 28, 2014 at 12:30 PM

    Hi Anil,

    did you manage to resolve this issue? I am having exactly the same problem.

    The suggestion to not use any IDs whatsoever in the views seems like a very unsatisfactory solution to me. Sometimes I need an ID for a control!

    I have also tried using createID() instead of hard-coding - same result.

    I don't really undertsand why the controls are not destroyed when the application/component is closed. They just seem to hang around, or at least the name hangs around. I have had occasions where the control itself (e.g. a page) does not exist, but I still get a duplicate ID error, when I try to create it again.

    Any further information you have relating to this issue would be very welcome.

    Thanks & Regards,

    Mike

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 28, 2014 at 01:10 PM

    Not sure on about the root cause of the issue. But changing the application type from LPD_CUST to SAPUI5 in launchpad admin page should fix this.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Cristoph,

      Thanks, actually I changed all my app to Router approach, and the error disappear, may be could I ask you something else, I don't want to handle bookmarking in routing so I would like to hide the hash that appears in url without changing my patterns, do you know if this can be possible?.

      Thank you very much in advanced.

      Best regards.

      Jhon Jairo.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2015 at 09:38 AM

    I have the same proplem with VariantManagmant and local launchpad. I can launch my application from the launchpad only one time. When we backed to launchpad and try to launch it again I've got duplicate id error. This id belonged to VariantManagment control. So I try to wrap this control using HorizontalLayout. I removed id from VariantManagment and added id to HoryzontalLayout. And it helped. Try to do something in this way

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2016 at 03:27 PM

    Just FYI,

    I also had the same error message.

    The reason was in Component name. I input company.app.Component while it should be just like company.app.

    So there is no .Component in Target mapping.

    Probably it can be useful for someone.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 06, 2016 at 11:05 AM

    Hello,

    I've been "fighting" with that same error. I'm using a Dialog to make the user "Continue" or "Cancel", and the Dialog, buttons and an input field have its own id.

    So when the user take a decision the first time all was working... but not the second time.

    The solution I have applied is to "destroy" the dialog once the user has clicked a button, instead of "close"... that way it seems that the Dialog is always been created each time is needed, and there's no conflict with the identifiers.

    var oButton2 = new sap.m.Button("Cancel", {

    text: "Cancel",

    press: function(oEvent) {

    //sap.ui.getCore().byId("returnDialog").close(); ---> Not working

    sap.ui.getCore().byId("returnDialog").destroy(); ---> Solution

    }

    });

    I hope it can help some of you.

    Regards,

    Juande

    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.