Skip to Content
avatar image
Former Member

error adding element with duplicate id

I am using a js view, in which when I am clicking on an inputfield for thr first time a dialog box pops up, but when second time I do the same it gives an error saying adding element with duplicate id, I have tried using this.createId(), but its not working. Please share some solutions

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Nov 04, 2015 at 06:36 AM

    Check out this link.

    Uncaught Error: Error: adding element with dupl... | SCN

    otherwise destroy your dialog after processing by writing oDialog.destroy();

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 04, 2015 at 06:17 AM

    inside your method.

    if(!this.dialog){

    this.dialog = new sap.m.Dialog(this.createId())

    }

    this.dialog.open();

    could you please use this approach.

    Thanks,

    Karthik A

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 04, 2015 at 06:59 AM

    Hi Tanya,

    var oDialog = new sap.ui.commons.Dialog({closed:function(){oDialog.destroy();}})
    

    Regards,

    Sai Vellanki.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 04, 2015 at 06:41 AM
    Add comment
    10|10000 characters needed characters exceeded