My dialog is defined as document:
onOpenDialog : function () {
var oView = this.getView();
var oDialog = oView.byId(\"helloDialog\");
// create
/***********************************/
onOpenAddEmployeeDialog: function () {
var oView = self.getView()
var oDialog = oView.byId('addEmployeeFragment');
if ((oDialog = !null)) {
var oDialog = sap.ui.xmlfragment(oView.getId(), 'sap.ui.view.AddEmployeeFragment'
oView.addDependent(oDialog);
}
var dialogModel = new JSONModel();
oDialog.setModel(dialogModel, 'dialog');
oDialog.open();
},
/***********************************/
/***********************************/
dialogAfterClose: function () {
var oView = self.getView()
var oDialog = oView.byId('addEmployeeFragment');
//clear dialog Data
var oDialogData = oDialog.getModel('dialog').getData();
Object.getOwnPropertyNames(oDialogData).forEach(function(d) {
oDialogData[d] =
});
dialogModel.setData(oDialogData);
oDialog.close();
oDialog.destroy();
},
/***********************************/
*AddEmployee.fragment.xml