I'm working on sapui5 application. I want to block UI form users during ajax requests. I added the following code:
var dialog = new sap.m.BusyDialog({ text : this.languageModel.getModelProperty("BUSY_DIALOG_FETCHING_DATA"), title : this.languageModel.getModelProperty("BUSY_DIALOG_WAIT") }); var that = this; jQuery.ajaxSetup({ beforeSend : function() { console.log("open"); dialog = (dialog) ? dialog : new sap.m.BusyDialog({ text : that.languageModel.getModelProperty("BUSY_DIALOG_FETCHING_DATA"), title : that.languageModel.getModelProperty("BUSY_DIALOG_WAIT") }); dialog.open(); }, complete : function() { console.log("close"); dialog.close(); } });
In console I get good results, and while debugging I can see dialogs, but in normal mode (without any breakpoints) dialogs don't appear at all. Any clue?