Hi,
I've tried using setBackDestination then calling back() when "Yes" is clicked on the confirmation dialog but it still isn't working.
This does nothing but close the confirmation dialog:
// On 'Sign out' button press
@Override
protected boolean onHomeFormSignOut() {
// Confirmation dialog
showForm("SignOutDialog", null);
return true;
}
// 'Yes' is clicked
@Override
protected void onSignOutDialog_YesButtonAction(Component c, ActionEvent event) {
// Set back destination
setBackDestination("SignInForm");
// Navigate back
back();
}
This, however, works but I'm not sure if it is allowed or good practice:
// On 'Sign out' button press
@Override
protected boolean onHomeFormSignOut() {
// Save back command in class variable
signOutBackCmd = Display.getInstance().getCurrent().getBackCommand();
// Confirmation dialog
showForm("SignOutDialog", null);
return true;
}
// 'Yes' is clicked
@Override
protected void onSignOutDialog_YesButtonAction(Component c, ActionEvent event) {
// Navigate backwards
showForm("SignInForm", signOutBackCmd);
}
Any idea what I'm doing wrong?
Thanks again