Blackberry - Disable Save option in BasicEditField?

前端 未结 3 1346
孤城傲影
孤城傲影 2021-01-13 12:34

I am using a basiceditfield to take input from the user to do some simple string search. But if i type a few letters and wish to go back without continuing the search, it au

相关标签:
3条回答
  • 2021-01-13 13:06

    Try adding this to your MainScreen class:

    protected boolean onSavePrompt() {
            return true;
        }
    
    0 讨论(0)
  • 2021-01-13 13:13

    modify onClose method of Screen

     public boolean onClose() {
       this.close();
       return true;
    }
    
    0 讨论(0)
  • 2021-01-13 13:15

    Another way would be to override the dirty state logic on your Screen class like this:

    public boolean isDirty() { return false; }
    

    Of course you can also just override that same method on a subclass of your Field, and that too should probably work. (assuming you still want to do dirty-state-tracking of other fields on the screen.)

    0 讨论(0)
提交回复
热议问题