Hello folks!
Though it seems to be quite a basic thing I could not find a solution by searching the internet. I simply like to detect and use the choice the user made after the view/discard/cancel button appears, e.g. to initialize some actions after the user clicked on "save". How can I request the result of the choosen button?
I tried to use the DialogClosedListener interface with its dialogClosed method but it it didn't work. I tried it like this:
Code:
public class SampleScreen extends DialogClosedListener{
...
// screen fields
...
public void dialogClosed(Dialog dialog, int choice){
if (choice == Dialog.DISCARD){
System.out.println("discard");
}
else if(choice == Dialog.CANCEL){
System.out.println("cancel");
}
else if(choice == Dialog.SAVE){
System.out.println("save");
}
if (dialog.getSelectedValue() == Dialog.DISCARD){
System.out.println("discard");
}
else if(dialog.getSelectedValue() == Dialog.CANCEL){
System.out.println("cancel");
}
else if(dialog.getSelectedValue() == Dialog.SAVE){
System.out.println("save");
}
}
}
Thanks for any suggestions!