Greetings, I have tried to use the plugin “ConfirmDialog” to return a boolean depending on what the user needs, this is what I have so far:
public static boolean showQuestion(String message)
{
final boolean[] confirmed = {false};
ConfirmDialog.show(
UI.getCurrent(),
"¿Are your sure?:",
message,
"Yes",
"No",
new ConfirmDialog.Listener() {
public void onClose(ConfirmDialog dialog) {
if (dialog.isConfirmed()) {
// Confirmed to continue
confirmed[0]
=true;
} else {
// User did not confirm
confirmed[0]
=false;
}
}
}
);
return confirmed[0]
;
}
My problem is that it always returns the false value.
What am I doing wrong?.
Thanks in advance for the help.