May 02, 2017, 2:59 PM
[CLOSED] MessageBox with Dialog buttons, wait for answer
Hello,
I am implementing the MultiUpload Grid. I have a dialog box so when the user clicks the upload button, if file already exists, there are 3 options: "Replace", "Update Version" and "Cancel". But the program is not waiting for the answer from the MessageBox and it's keep running so I cant get the new value for txtAction.
Second question: Is it possible to change the buttons' text? Instead of Yes, No, Cancel.
Code Behind:
I am implementing the MultiUpload Grid. I have a dialog box so when the user clicks the upload button, if file already exists, there are 3 options: "Replace", "Update Version" and "Cancel". But the program is not waiting for the answer from the MessageBox and it's keep running so I cant get the new value for txtAction.
Second question: Is it possible to change the buttons' text? Instead of Yes, No, Cancel.
Code Behind:
...
if (sFileName1.Replace(sFileExt1, "") ==
sFileName.Replace(sFileExt, ""))
{
X.Msg.Show(new MessageBoxConfig
{
Title = "File exists",
Message = "Yes:Update, No:Replace, Cancel:Discard",
Buttons = MessageBox.Button.YESNOCANCEL,
Icon = MessageBox.Icon.QUESTION,
Fn = new JFunction { Fn = "setValue" }
});
if (txtAction.Text != null)
{
if (txtAction.Text == "Discard")
{
iFailedCnt += 1; // NOT ALLOWING DUPLICATE.
txtAction.SetValue(null);
break;
}
}
}
...
JS:...var setValue = function (btn) {
if (btn == "yes") {
#{txtAction}.Text == "Update";
}
else if (btn == "no") {
#{txtAction}.Text == "Replace";
}
else if (btn == "cancel") {
#{txtAction}.Text == "Discard";
}
};
...
Last edited by fabricio.murta; Jun 09, 2017 at 6:22 PM.
Reason: no feedback from the user in 7+ days