cancel
Showing results for 
Search instead for 
Did you mean: 

error adding element with duplicate id

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Private_Member_15166
Active Contributor

Check out this link.

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

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

Answers (3)

Answers (3)

saivellanki
Active Contributor
0 Kudos

Hi Tanya,


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

Regards,

Sai Vellanki.

karthikarjun
Active Contributor
0 Kudos
karthikarjun
Active Contributor
0 Kudos

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