06-08-2009 10:46 PM
Solved! Go to Solution.
06-08-2009 11:19 PM - edited 06-08-2009 11:20 PM
Override onSavePrompt() and put up your own dialog.
Anyway, onSave() is never called if the user cancels the save prompt.
06-08-2009 11:27 PM
06-08-2009 11:38 PM - edited 06-08-2009 11:42 PM
So like I said, override onSavePrompt and put up your own prompt. onSavePrompt is responsible for calling onSave - so if the user cancels, you don't call it:
protected boolean onSavePrompt()Invoked when the screen should prompt to save its contents.
The default implementation is empty. Overriding classes should provide a dialog and call onSave if the user has chosen to save. If the return is true, the framework will call onClose.Returns: True if the screen should close; otherwise, false Since: JDE 3.6.0 See Also: MainScreen.onSavePrompt() Category:
06-08-2009 11:42 PM
06-08-2009 11:46 PM - edited 06-08-2009 11:46 PM
"Save" calls onSave. "Cancel" does nothing, just closes the prompt. "Discard" closes the screen without calling onSave.
Put up your own dialog, and act according to the user response.
06-09-2009 01:28 AM
06-09-2009 01:45 AM
Yes, the post above is correct, it resolved my problem.
Somehow, in my testing I saw that Save() was called on both "Discard" and "Save" actions, this got me confused. But re-testing it again produced expected results. I just did something wrong before and was not paying attention.