Hi Robin,
I have defined Id of dialog as below:
new sap.ui.commons.Dialog("Dialog",{closed : function(oControlEvent) {sap.ui.getCore().getElementById('Dialog').destroy(); }
On click of close button,if alert sap.ui.getCore().getElementById("Dialog") it gives undefined.
I mentioned Id of dialog and as you say no matter where you defined your dialog,it should work.
But still it is giving error:
Unable to get value of the property 'destroy': object is null or undefined.
I m unable to understand what's going wrong.
Please guide
Regards,
Neha