I am going nuts over a trivial problem using Ext.MessageBox asking the user to a confirm a question. I am using Ext 3.1.1. and I took the code from the message box example #4 from ../examples/message-box/msg-box.js and embedded it into some method in one of my classes to call it from my code. Here is this method:
Code:
Translation.prototype.openDialogYorN = function(title,text){
Ext.MessageBox.show({
title: title,
msg: text,
buttons: Ext.MessageBox.YESNOCANCEL,
fn: showResult,
// animEl: 'mb4',
icon: Ext.MessageBox.QUESTION
});
};
function showResult(btn){
Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
};
The program flow never stops to wait for user response after showing the message box!
I don't understand that, especially because this is exactly the same code that is used in the example - with the only difference that it is "isolated" into another method and not called from any event.
What am I doing wrong?
This is so trivial....
Just for the records: In the "doc" it says: "showing a MessageBox will not cause the code to stop. For this reason, if you have code that should only run after some user feedback from the MessageBox, you must use a callback function (see the function parameter for show for more details)."
Well, I am clearly using a callback function - or rather so does the code copied from the example. Thus, either must be wrong: the doc or something in the code.
Thanks for any hint!