I want to load the third-party module on the click of the sap.m.Button
. As the library takes a little time for loading, I want to show the view busy. But it is not working. I want to load the third-party module, and after loading and executing the functionality of the module, I want to set the view busy to false
.
Controller:
onPressDownload: function () {
var view = this.getView();
view.setBusy(true);
jQuery.sap.require('pdfmake.build.pdfmake');
jQuery.sap.require('pdfmake.build.vfs_fonts');
if (pdfMake) {
var docDef = "";
pdfMake.createPdf(docDef).download();
view.setBusy(false);
}
},
View:
var oBtn = new sap.m.Button({
press: [oController.onPressDownload, oController]
});
As jQuery.sap.require
makes a synchronous call, view.setBusy
should work. But it is not working as expected, and view.setBusy()
resets immediately to false
. Is there anything I am doing wrong?