PDA

View Full Version : Wait Message on Ext.Ajax.request



ejml
6 Jul 2010, 2:30 AM
Hello Folks!,

I have tried the next to implement a wait message when is executed a Ajax request:



sendElement: function(quotationValue){
var waitBox = Ext.MessageBox.wait('Procesando..., por favor espere');
Ext.Ajax.request({
url:'/salesQuotationSend.htm',
params: {quotationId: quotationValue},
success: function(response){
var result = Ext.util.JSON.decode(response.responseText);
if(result.success != ""){
window.open('/salesQuotation.htm?checkOkSend=1','_self');
}
else {
window.open('/salesQuotation.htm?checkOkSend=-1','_self');
}

},
failure: function(){
waitBox.hide();
window.open('/salesQuotation.htm?checkOkSend=-1','_self');
}
});
}


But the message not appear, Can you help me, please?.

Thanks in advance!!

Best Regards!

Animal
6 Jul 2010, 5:40 AM
Typing



Ext.MessageBox.wait('Procesando..., por favor espere')


into the Firebug console displays the message box for me.

So it seems your code is not even being executed.

ejml
6 Jul 2010, 6:49 AM
Hi Animal,

Thanks by your reply, this is the code that firebug show in the script:



sendElement: function(quotationValue){
var waitBox = Ext.MessageBox.wait('Enviando presupuesto..., por favor espere');
Ext.Ajax.request({
url:'/salesQuotationSend.htm',
params: {quotationId: quotationValue},
success: function(response){
var result = Ext.util.JSON.decode(response.responseText);
if(result.success != ""){
window.open('/salesQuotation.htm?checkOkSend=1','_self');
}
else {
window.open('/salesQuotation.htm?checkOkSend=-1','_self');
}

},
failure: function(){
window.open('/salesQuotation.htm?checkOkSend=-1','_self');
}
});
}


Greetings!.