Skip to Content
-2

UI5 Error: adding element with duplicate id 'container-JsonTable---View1' -

I have created one table and by clicking on a row it will navigate to next view and display a person's detail.

I dont know in which file i am getting error

1.View1.view.xml

2. detail.view.xml

Let me know if any code sharing is required

Thanks

Add a comment
10|10000 characters needed characters exceeded

  • I used to get the same error. The problem what i did was in the main view that i created(View1.view.xml),in that i changed the Appid as View1 <App id ="view1"> and in manifest.json file "routing": { "config": { "routerClass": "sap.m.routing.Router", "viewType": "XML", "async": true, "viewPath": "com.incture.ZDemo_Routing2.view", "controlAggregation": "pages", "controlId": "View1", "clearControlAggregation": false },...}

    i changed controlId as View1. So this was causing me the problem. When i changed the "controlId":"app", that worked fine.

Related questions

5 Answers

  • Posted on Aug 09, 2019 at 02:11 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 09, 2019 at 02:59 PM

    Hi Jainee Solanki,

    This is happening because while you are navigating back to First view Control is getting created with same ID.

    To understand more about Routing and Navigation please visit below links.

    https://help.sap.com/doc/saphelp_uiaddon20/2.05/en-US/e5/200ee755f344c8aef8efcbab3308fb/content.htm?no_cache=true

    https://sapui5.hana.ondemand.com/1.34.7/docs/guide/1b6dcd39a6a74f528b27ddb22f15af0d.html

    Hope this Helps.

    Thanks-

    Abhishek

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 12, 2019 at 09:03 AM

    Can anyone let me know which file will be causing error .json or .js or .xml?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 16, 2019 at 04:34 AM

    Hi Jainee,

    You may be getting error in file "View1.controller.js".

    Please share the error details and code snippet to find exact issue.

    Regards,

    Rama

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 30, 2020 at 02:25 PM

    I used to get the same error. The problem what i did was in the main view that i created(View1.view.xml),in that i changed the Appid as View1 <App id ="view1"> and in manifest.json file "routing": { "config": { "routerClass": "sap.m.routing.Router", "viewType": "XML", "async": true, "viewPath": "com.incture.ZDemo_Routing2.view", "controlAggregation": "pages", "controlId": "View1", "clearControlAggregation": false },...}

    i changed controlId as View1. So this was causing me the problem. When i changed the "controlId":"app", that worked fine.

    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.