09-16-2011 10:37 AM
Firstly I have searched, and have seen the solutions to setDirty(false) or to override the onSavePrompt(true) examples, however I am having some problems with intergrating this within my existing code.
My class is extending a different module not MainScreen (is this the problem?) and I am overriding the makeMenu item to populate my menu.
What I require is for the ability to hide the silly "Changes Made" prompts box shown within my menu close item. My Code at the moment is this
Here is a snippet of my code...
public final class fgw_home_screen extends TooltipScreen implements TooltipListener, TxtPackResource {
public fgw_home_screen() {
//create a menu item for users to close the application
private MenuItem _closeItem = new MenuItem(_txt.getString(BTN_CLOSE), 200000, 10) {
public void run()
{
onClose();
}
};
//override makeMenu to add the new menu items
protected void makeMenu( Menu menu, int instance )
{
menu.add(_closeItem);
}
}
Solved! Go to Solution.
09-16-2011 11:01 AM
Try this in your screen class:
public boolean onClose() {
return true;
}
private MenuItem _closeItem = new MenuItem("Close", 200000, 10) {
public void run() {
close();
}
};
09-16-2011 11:10 AM
No change im afraid, its still prompting saying "changes made!"
09-16-2011 11:18 AM
09-16-2011 11:23 AM - edited 09-16-2011 11:58 AM
Sorry that didnt work either...
Here is my complete code
no longer needed
09-16-2011 11:42 AM
private MenuItem _closeItem = new MenuItem("Close", 200000, 10) {
public void run() {
close();
}
};
public boolean onClose() {
return super.onClose();
}
public boolean onSavePrompt() { return true; } This works for me
09-16-2011 11:56 AM
Works a treat - thanks.
I must of been doing something different. Thanks again!