My app features a popup menu (contextual menu) on certain elements.
I create this dialog (just some options are in the code snippet below):
public static String openContextualMenu()
{
Dialog alertDialog = new Dialog();
alertDialog.setLayout(BoxLayout.y());
Button editCommandButton=new Button(new Command(stringEdit));
Button deleteCommandButton=new Button(new Command(stringDelete));
Button exportCommandButton=new Button(new Command(stringExport));
alertDialog.add(editCommandButton).add(deleteCommandButton).add(exportCommandButton);
Command commandResult=alertDialog.showDialog();
String result=commandResult.getCommandName();
return result;
}
I think this is the right way to create a popup menu in Codename, isn't it?
However I would like to handle the case when the user dismiss the dialog with the back button or tapping outside. Is it possible? This could be useful also for other dialogs of my app.