Skip to Content
0
Jun 16, 2020 at 03:04 PM

how to close dialog in sapui5

1434 Views

I am trying to call the function that closes the dialog from a sucess function, as follows:


function close onCloseDialog()

_getDialog: function () {
	// create dialog lazily
	if (!this._oDialog) {
	   // create dialog via fragment factory
	   this._oDialog = sap.ui.xmlfragment("mta.HealthCare.view.NuevoEPPDotacion", this);
	}
	return this._oDialog;
},
onCloseDialog: function () {
	this._getDialog().close();
},


function of the Guardar button

...
this.oModel.create("/EPPDOT", oData, {
  success: function (oCreatedEntry) {
	MessageToast.show("Registro exitoso!");
	this.onCloseDialog();  //close dialog
  },
  error: function (oError) {
	MessageToast.show("Error de registro");
  }
});

the registration is successful but it doesn't close the dialog, How could I do that?

Attachments

o6tfw.png (55.8 kB)