When you close the popup only proceed

Hello

In my fieldChanged(), I ask a pop-up message. The popup has a close button that closes the popup. I don't want the application to perform the work until the context menu does not close. I am not able to do this. The code is:

    public void fieldChanged(Field f, int context) {
        System.out.println("Into ------------ BUTTON CLICKED = " + f + " C0NTEXT = " + context + " btnClicked = " + btnClicked);
        if (f instanceof CheckboxField) {
            CheckboxField cb = (CheckboxField) f;
            // Get details associated with the selected checkbox
            UiApplication.getUiApplication().invokeAndWait(new Runnable() {
                    public void run() {
                        getScreen().getUiEngine().pushScreen(new MessagePopup(mm1));
                        return;
                    }
                });
                // Change some data and invalidate
                if (mm.read == false) {
                    mm.read = true;
                    cb.setCookie(mm);
                    unreadCount -= 1;
                    if (unreadCount < 0)
                        unreadCount = 0;
                    System.out.println("UNREADCOUNT =  " + unreadCount + " ******************* ");
                    inboxBtn.setText("Inbox " + unreadCount);
                    invalidate();
                }
                System.out.println("CheckBox Complete");
             }
        }

   // POPUP CLASS
    class MessagePopup extends PopupScreen  implements FieldChangeListener  {
        private BitmapButtonField okBtn;

        public MessagePopup(MailMessage mm) {
            super(new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR));
            okBtn = new BitmapButtonField(Bitmap.getBitmapResource("res/cancel_btn.png"));
            okBtn.setChangeListener(this);
            add(new LabelField("Label "));
            add(okBtn);
        }

        public void fieldChanged(Field field, int context) {
            if (field == okBtn)
                this.close();
        } 

        protected boolean keyChar(char key, int status, int time) {
            if (Keypad.KEY_ESCAPE == key) {
                this.close();
                return true;
            } else
                return super.keyChar(key, status, time);
        }
    }

The output is: popup appears and I see the following SOP

CheckboxField Selected * READ = false *.
UNREADCOUNT = 4 *.

Complete box

According to me, when I click on the Ok button in the pop-up window and then 2 lines that is below

UNREADCOUNT = 4 *.

Complete box

must be executed.

No idea how to work with this scenario. Any help is very appreciated.

Thank you

As I understand it, you don't want "if(mm.read == false)" to get executed until the screen closes?

If this is correct then replace "pushScreen' by 'pushModalScreen '. Block screens mode until the screen is closed. You have not need surgery of invokeAndWait from the modal screen will block the execution anyway.

Tags: BlackBerry Developers

Similar Questions

  • How to make a uiapplication closes not when you close the last screen

    By default, when you close the last screen will come out of the UiApplication, but I want what he requestBackground,

    example: If the last screen is the screen invokeapplication and close() is default, then how in the background?

    It is much easier to understand what you mean if you use the real java involved rather than trying to use the shortcut.  I copy your programs and paste it here too, so you don't get as typos:

    invkoeapplication

    that can confuse us mortals.

    It seems you are trying to call another Application is not your own.  Says Simon, if you don't 'own' Application/screen, you have no control over what he does.

    What I don't understand is that if you call the Messages application, then your Application must not be closed.  Is it?  What did you try to stop?

    It would be perhaps better if you explained exactly what you're trying to do, we are all aware, on what is the problem.

  • When you close the form "Do you want to save the changes" window

    Hello
    I have a master form / detail where in my trigger after QUERY I change the item field data of LOV to a value non-base. When I simply select Master record(NOT in query mode) my detail records pop up in the retail block. This is done in EXECUTE_QUERY in trigger a TIME NEW BLOCK INSTANCE in detail block. But when I close the form he's asked me to save changes even though I haven't changed anything. I have this statement after QUERY Trigger
    SET_RECORD_PROPERTY(:SYSTEM.) TRIGGER_RECORD,: SYSTEM. TRIGGER_BLOCK, STATUS, QUERY_STATUS); This problem doesn't happen in QUERY MODE.

    I tried the two Set_Item_Property('BLOCK.) CODE', ITEM_IS_VALID, PROPERTY_TRUE); This property in the POST_QUERY and the Set_Item_Property ('item_name', VALIDATE_FROM_LIST, PROPERTY_TRUE); in QUERY-MASTER / DETAILS trigger but it did not work.

    Help, please

    Thank you

    If you take the second codepart, you may need to add a CREATE_RECORD in the last ELSE like:

        ELSE
          -- No master-record, found, use has to enter data, FK_ID can be pre-populated from the LoV-Selection
          CLOSE crCheck;
          -- Create an empty reocrd here
          GO_BLCOK('MASTER');
          CREATE_RECORD;
          :MASTER.FK_ID:=:BL_CONTROL.IT_FK_ID;
        END IF;
    

    I hope this helps.

  • I'm trying to get the bookmark icon in my toolbar to the right of the icon of the House. I right click on the toolbar, and then customize the icon is displayed in the toolbar. When I close the popup on the toolbar icon in my toolbar disappears.

    I'm trying to get the bookmark icon in my toolbar to the right of the icon of the House. Then, right-click on the toolbar and then click Customize the icon in the toolbar. As soon as I close the pop of toolbar Customize the icon on my toolbar disappears. How can I get the Favorites icon to stay on my toolbar to the right of the icon of the House?

    Two things can cause the Bookmarks button to "disappear" from the Navigation bar when the customization mode is closed.

    1. the Menu bar - with File, Edit, View, etc. - shows.

    Since you have checked the answer first of cor-el solve your problem, I have not exposed on this point.

    2. the bookmarks toolbar shows, and this button is this toolbar.

    Is the Menu bar showing or not?

    Have you tried the reset bar of tools and commands that I mentioned?

  • Display to display base Windows aero changes when you use the battery only

    original title: basic display Windows

    Each time, I unplugged and running off my block the display configuration changes to Windows 7 Basic.  I have change for a theme aero setting initially, it came with but everything it will use is Windows 7 basic when disconnected.  It uses only the aero effect when the laptop is plugged.  I would like to use aero while plugged in or unplugged it just don't apply it for some reason any.

    Hello

    Looks like your battery may not be generating enough power to manage the resources that are required by the Aero display.

    You can create a detailed report on the State of the battery to double check the battery status.

    1. go to Start / all programs / Accessories. Click on the command prompt and select run as administrator.

    2 in the command prompt window, copy / paste the following command.

    powercfg-energy-output %userprofile%\desktop\energy-report.html

    Press ENTER.

    Wait for the command to complete (usually about 2 minutes).

    This create a file named energy - report.html and place it on your desktop.

    3 go to your desktop and double-click the file to open.

    Scroll to the bottom for the battery: battery information section.

    You will see:

    Rated xxxxx

    Xxxxx full last Charge

    (Where xxxxx is a number)

    Copy this article and paste in an answer here, for analysis.

    Concerning

  • success message to display on the homepage after you close the popup skillbuilder page

    Hello

    I try to add a quick success message appears on the home page after clicking on "Apply/Save" on the page open popup. I created a popup page using popup skillbuilder plugin using two links "Edit" on the report and create a button to popup new entry record page,.

    Description: on my main report page 1 I "edit" links and create button what up page2 another pop-up windows but I want to show the success confirmation message on the page1/report after you apply the modification/creation of a record a closed time page2/popup how can I achieve this?

    using apex 4.2. Can someone please help with that?

    Thank you.

    I got it with a few tips... closed jQuery.

  • Pavilion g6t locked up, while you sleep, when you close the lid, or try to power off

    My Pavilion g6t crashes when the screen turns off, or computer goes to sleep, also is not out with stop-power function.  Power light stays on, only is to restart the computer to completely turn off with power button / stop, and then re login.   This happened just after a HP recommended Refresh, any ideas?

    I went back to the HP driver downloads support and ran an another Bios Update.

    Alto, the computer began to work properly, the screen will be lite to the top of the keyboard.

    Once asleep, wakes you up by button tapping power and computer stops correctly.

    HP/Microsoft should seek to solve the problem of no compatibility with Bios level and

    other 'stuff' in the computer.

    Thank you

    Glenn

  • 10.1.7 Adobe will not close in the Task Manager when you exit the program. High CPU

    Hello

    10.1.7 updated and I noticed that when you close the program, an instance of acrobat remains open in the Task Manager with the use of high CPU 50% +. Close any, unless you complete the task. If you open adobe still a new instance opens again consume more cpu and paralyzes the machine with high CPU. It's on computer 64-bit win 8. The work of previous 10.1.6 liberation for a while on the same machine without any problems.

    Thanks in advance

    How to restore for me

    1.

    Uninstall Acrobat X

    2.

    Used my initial installationfile for AcrobatX 10.0.0

    3.

    Downloaded for ftp://ftp.adobe.com/pub/adobe/acrobat/win/10.x/ 10.1.5 update

    List of compatible updates can be found here. http://helpx.Adobe.com/Acrobat/release-note/release-notes-Acrobat-Reader.html

  • When I close the lid on my MBP, it goes to "Standby" to "Hibernate" why?

    My MacBook Pro for six years had been working perfectly until about a month earlier, when he stopped to stay in Mode standby when I closed the lid.

    With the lid closed, initially, he goes to sleep, but after about 30 seconds, it goes into hibernation mode and to turn on again, I have to press the power button. I then get a grey screen and no use of the trackpad. Shortly after, the gray screen disappears and the machine works perfectly.

    The battery life is very good (68%), I have reset the SMC and I have not loaded the new software. The only thing I can think is that this started to occur at the time of the last update of Safari.

    Does anyone else have this problem?  Comments or suggestions are appreciated.  Thank you.

    Hello, Spring Lake Bob!

    Thank you for using communities Support from Apple. After reviewing your post, I understand that your MacBook Pro sleeps as expected when you close the lid. Instead, it goes into a hibernation mode that requires you to press the power button to interact with him again. I certainly understand wanting to make sure that the computer sleeps when it should wake up how it should. I'd be happy to help you!

    Get help with your situation, I would say using the article below the link to help isolate and solve the problem of sleep.

    If your Mac does not sleep or wake up when expected

    See you soon!

  • Is it safe to use keyboard if I put the microfibre cloth on top of the keypad cover when I close the mac? (mac pro retina display)

    Hi all.

    I use Kuzy keyboard cover on my mac pro retina display.

    I read that Apple does not recommend to use the keypad cover when you close the mac of retina display.

    So I wonder if it would be dangerous to use key cover if I put the microfibre cloth on top of the keypad cover when I close the mac?

    In this way, would the retina display not scratched by a keyboard cover?

    Please share an idea about it, thank you.

    It is not only the possibility of a scratch, but also that the MacBook Pro retina are very thin. Adding a keyboard cover and a cloth could lead to damage and it closes does not correctly. I have personally not use either on my rMBP.

    To activate the thin design of MacBook Pro with computers of Retina display, the distance between the screen and the top box is designed to close tolerances. Do not use palm rest covers or covers of CAP, because the extra thickness can interfere with the closing designed screen position.

  • How can I stop Firefox closes when I close the last window open?

    I had to get Windows 7 reloaded and my backup was corrupted (i.e., I couldn't use my custom Firefox.) So I downloaded the new Firefox and now it closes automatically when I close the last window opened. I prefer that Firefox stay open until I chose to close it. How to achieve this?

    Hello 1DKG, do you mean when you close the last open tab? If yes you can replace it as follows:
    enter on: config in the address bar of firefox (confirmed the message information where it appears) and search for the preference named browser.tabs.closeWindowWithLastTab. Double-click it and change its value to false.

  • Satellite A100-049 - how can you stop it turn on when you open the lid?

    I don't see any option to stop this in the BIOS or otherwise but it annoyingly turns on when you open the lid. I stopped it turn off when you close the lid, but prefer that he remained turned off when you open the lid.

    Any ideas?

    Hello

    I assume you are using the Vista operating system.
    Have you checked the Power Options OS located in the control panel? Do it!

    But a question; Why you use n t stop him if you n t want to turn on the laptop by opening the cover.

  • Satellite C650 stops when I close the lid

    I recently got my laptop for Christmas, and a few weeks ago, I noticed that whenever I opened the cover, I had to turn it back on. He woul say the computer stops unexpectedly. Then you choose the security mode or regular. You hit one and we would send you to the Start Up repair.

    What should I do to get that normal back where I can close the lid and then open it again without having to reboot and wait more than seven minutes to start repair.
    Also, I got the blue screen.

    Do I have a virus, or is there another way I could fix it?

    Stand by. In the history I n t understand one thing: in power options on the side left (blue color), you can find the option choose closing the cover. Which option is implemented here?

    What should your laptop when you close the lid?

  • Is it safe to leave the cover of the keyboard between the keyboard and screen retina when I close the macbook?

    Hi, I have a macbook pro 15 "retina.

    I got the cover of the keyboard (not cheap but decent), and I use it everytime I open my macbook.

    However, I heard that it would be dangerous to leave the keypad cover when you close the macbook. Because it could hurt the sensitive retina screen.

    Is this true?

    Is it safe to leave the cover on my keyboard when I close the macbook? It's a little annoying move coverage of my keyboard everytime I have my macbook to opening / closing.

    If it's dangerous, is there a cover keyboard without danger to the retina on the market?

    Thanks for the help!

    I have used Moshi Clearguard kb current covers on two MacBook Pro, including retina mid-2014, I usually use closed with my Apple display 27 ". I put KB covers on as soon as I bought computers and have never deleted without fingers never touched my keys. I did it because I saw how dirty the kbs in the Apple Store, and the seller told me that once the black keys are oily, it is impossible to clean completely. I started with a silicone rubber cap. Three weeks later, I threw it in disgust and I bought a Moshi to replace.

    Moshi rugs are much thinner and lighter than the silicone rubber ones more adapted, hold their shape better, stay clear longer and are much easier to clean and type through. In addition to the one on my computer Ko, I keep one on the external Apple wireless keyboard which is always exposed on my desk. These caches really keep particulate crud, and they do not interfere with my typing at all. When they are dirty, I rub it in the sink with a detergent and a brush to vegetables, and when possible discoloration becomes noticeable after three or four years, I replace it with new ones.

    My previous MBP, a Core 2 Duo late 2008 unibody model, allows to get much hotter than my current on occasion, and I fear sometimes that heat buildup between the lowercase and the display closed would cook the KB cover or even the screen itself. But that never happened, but I guess it might have helped if any yellowing of the coverage.

    If use you Moshi hiding for seven years, I would never consider a time using a silicone back cover. I did not, and you shouldn't worry about all to close your view on a Moshi.

  • Laptop shuts off and turns on when I close the lid

    Hi, I just bought a HP Pavilion 15-n253sv and I noticed that when I close the lid its turns off instead of getting in standby mode. Also when I stopped it, and then I close the lid it lights up. Its like the on off button. Is it a hardware problem that I must return the laptop? I checked out the settings and it is said that when the lid is closed it just goes to the standby mode. I have win 8.1.

    Hi Biliou,

    Welcome to the Forums of HP Support!

    If I understand you correctly, your computer shuts down when you close the lid, and if it is turned off and you close the lid it lights.  I think you are right to think it's a hardware problem. You can contact our technical support at the 800-474-6836. If you do not live in the United States / Canada region, please click on the link to get help from your region number. Contact HP worldwide

    I hope that this helps, please let me know how it goes.

    Thank you and have a great day!

Maybe you are looking for

  • Apps will not update

    My apps on my iPhone with the current iOS 9.3.1 5s will not update.  The message says waiting for updates as the icon next to the name of the app shows the circle with the square in the Center and nothing more.  It updated fine a few days ago, but no

  • 32 or 64 GB apple tv

    Hi, what is the best 32 or 64 GB apple tv? as this is a new platform & I don't know what is the size of the apps does anyone have the 32 GB to share the experience? If its just or 64 GB will be better?

  • How to create a multidimensional array constant?

    I have a code where I'm trying to mathematically manipulate tables in a while loop. I was counting on multiplying one table by a constant, but on the second iteration the constant actually eventually change to an array of different constants *. So, I

  • Photosmart 6520: printers claim code

    accidentally deleted the printer. must re - install. printer code does not demand. Can't find the page to print

  • Problems when using i18n

    Hello Experts! I do some itens for i18n, initially my build has worked well, but after that, every place where I use the reference for i18n interface generates the problem, because the directory interface was generated