Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[SAPUI5] Busy Dialog

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
onInit: function () {
    this._oModel = this.getOwnerComponent().getModel();
},
 
onButtonPress: function (oEvent) {
    //get Data
    var sPath = oEvent.getSource().getBindingContext().sPath;
    var oData = this.getView().getModel().getObject(sPath);
    var that = this;
 
    //busy on
    this._busyDialog = new sap.m.BusyDialog({});
    this._busyDialog.open();
 
    //create
    this._oModel.create("/DataSet", oData, {
            success: function (oData) {
                    that._busyDialog.close();
                    sap.m.MessageToast.show(that.getResourceBundle().getText("ok"));
            },
            error: function (oError) {
                    that._busyDialog.close();
                    sap.m.MessageToast.show(that.getResourceBundle().getText("nok"));
            }
    });
},