Close popup screen programmatically

I have a popup screen that I displayed to inform the user that they are wating on entry. When I try to close it in my earpiece method it gives the error:

IllegalStateException - UiEngineImpl.assertHaveEventLock)

I push the pop-up screen on the stack using a runnable.invokeAndWait and push as a ModalScreen because otherwise it will not show.

What is the error of assertHaveEventLock for, and why the window display not using invokeLater and pushScreen?

The IllegalStateException is thrown because the thread that calls the close method (the listener) is not the thread main event.  Calling the method close must occur in a block, as described on the next page.

How - to upgrade a screen on the main event Thread
Article number: DB-00136

http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800256/...

Tags: BlackBerry Developers

Similar Questions

  • How to close a popup screen pushed as a global screen

    I want to close a popup screen but my application is in background so

    UiApplication.getUiApplication () .popScreen (getScreen ());

    or

    UiApplication.getUiApplication () .getActiveScreen () m:System.NET.Sockets.Socket.close ();

    does not work is not something

    same Ui.getUiEngine () .getActiveScreen () m:System.NET.Sockets.Socket.close () does not work...

    in the popup screen, I have a custoListView (written own filed) there is an item when you click on an event

    listner function is called by there, I have to close popup screen... my class is like that

    SerializableAttribute public class SelectSms extends PopupScreen {}

    private vector _data;

    public boolean onClose() {}
    try {}
    Close();
    Returns true;
    } catch (Exception e) {}
    Returns false;
    }
    }

    public SelectSms() {}
    Super (new VerticalFieldManager(), Field.FIELD_VCENTER);
    _data = null;
    _data = MessageStore.getMessage ();
    last post [] message = Message [_data.size (new)];
    MSGC [] CustomListField = null;
    MSGC = new CustomListField [_data.size ()];
    for (int i = 0; i)<>
    message [i] = (Message) _data.elementAt (i);
    MSGC [i] = new CustomListField (message [i] .getMSG_BODY (), message [i] .getMSG_NO (), and [i] .getMSG_STUS ());
    last post mesg = message [i];
    MSGC [i] .setChangeListener (new FieldChangeListener() {}
    ' Public Sub fieldChanged (field field, int context) {}
    onClose();
    }
    });
    Add (MSGC [i]);
    }
    can someone help me how to close the popup screen.
            
    }
    }

    Place the UiApplication.popScreen () call in an executable object and pass this object to UiApplication.invokeLater ().

  • How do I close the popup screen

    Hey, I opened a popup screen on the click of a menu item

    now, if the user presses the ESC key

    the pop-up screen should close

    I tried in a certain way, but does not work what to do

     protected boolean keyChar(char c, int status, int time)
            {
                 boolean retVal = false;
    
                if (c == Characters.ESCAPE)
                {
                    close();
                    UiApplication.getUiApplication().invokeLater(new Runnable()
                    {
                        public void run()
                        {
                            UiApplication.getUiApplication().popScreen(filter);
                            UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());//(filter);
                        }
                    });
                    retVal = super.keyChar(c,status,time);
    
                }
                return retVal;
            }
    

    kindly help what to do.

    the popup screen is blocked unless I click on a button on the pop-up screen for certain work

    What to do?

    Your pop-up screen should respond the the ESC key by calling the close() method.

    Override keyChar() in the pop-up screen, search for the ESC key and call close().

  • How to recover data from an editable on a Popup screen field

    I have a popup screen that consist of two edit fields that contain the end and address of starting point. It seems that I can't recover the data that are filled in the fields. I would use the address to find the latitude and longitude in an attempt to invoke the map.

    CustomPopup screen = new CustomPopup(myAddress, data.getAddress());
         _controller.getUiApplication().pushModalScreen(screen);
    String newEndPoint = screen.getEndPoint();
    String newStartingPoint = screen.getStartingPoint();
    
     public CustomPopup(String sPoint, String ePoint)
        {
           super(new VerticalFieldManager());
    
           XYEdges thickPadding = new XYEdges(1,1,1,1);
    
           LabelField endDirection = new LabelField("End Point:");
             add(endDirection);
    
           EditField endPoint = new EditField("",ePoint.toString());
           Border eBorder = BorderFactory.createRoundedBorder(thickPadding, Border.STYLE_SOLID);
           endPoint.setBorder(eBorder);
           add(endPoint);
           add(new EditField(Field.NON_FOCUSABLE));
    
           LabelField startDirection = new LabelField("Start Point:");
             add(startDirection);
    
           EditField startingPoint = new EditField("",sPoint.toString());
           Border sBorder = BorderFactory.createRoundedBorder(thickPadding, Border.STYLE_SOLID);
           startingPoint.setBorder(sBorder);
           add(startingPoint);
           add(new EditField(Field.NON_FOCUSABLE));
    
           okButton = new ButtonField("OK", ButtonField.CONSUME_CLICK | Field.FIELD_HCENTER);
             okButton.setChangeListener(this);
             add(okButton);
    
        }
         public String getEndPoint()
         {
              if (endPoint == null) {
                  Dialog.alert("You must enter an Address!");
            }
            else
            {
                  return endPoint.getText();
            }
               return null;
         }
    
          public String getStartingPoint()
           {
               if (startingPoint != null) {
                   return startingPoint.getText();
    
              }
               return null;
           }
    
           public void fieldChanged(Field field, int context) {
               if (field == okButton) {
                   close();
              }
           }
    

    Hello

    Add the statement as startingPoint.setText (startingPoint.getText ()) and endPoint.setText (endPoint.getText ()) after creating the instance of starting point and the end point.  I think that this will solve your problem.

    -Roshn

    Press the button so resolute Bravo

  • How to make a Popup screen

    I really need help. I can't find anything specifically about this in the forum. I am very new and everything on the forum talking about things that I don't even understand yet; As the resolution of problems.

    I want just a genius to help me do that. I want to click a button and have a smaller popup screen with more buttons of your choice. That's all. Please help someone.

    The tutorials already on the site (as pdf files) are not helping. She only gives a big piece of code without explanation. I really need to understand on this.

    Hi coilfyzx,

    To create your own popupscreen, you must extend the PopupScreen class to your class. And you must provide a handler delegate to this extended class to manage presentations.

    public class popupScreen extends PopupScreen implements FieldChangeListener {
          private ButtonField mOKButton,mCancelButton;
          popupScreen(){
    
              super(new VerticalFieldManager(NO_VERTICAL_SCROLL | USE_ALL_HEIGHT), PopupScreen.DEFAULT_CLOSE);
    //here verticalfieldmanager is the delegate manager
    
           HorizontalFieldManager hfm = new HorizontalFieldManager(FIELD_HCENTER);
    
            mOKButton = new ButtonField("OK", ButtonField.CONSUME_CLICK);
            mOKButton.setChangeListener(this);//this is to listen for button click event
            hfm.add(mOKButton);
            mCancelButton = new ButtonField("Cancel", ButtonField.CONSUME_CLICK);
            mCancelButton.setChangeListener(this);
            hfm.add(mCancelButton);
    
    // now you can add your buttons here.
    
          }
    /*FieldChangeListener is for button click event in the popupscreen. For this you should implement the method fieldChanged because FieldChangeListener is an interface */
    
    public void fieldChanged(Field field, int context) {
            if (mOKButton == field) {
                //do whatever you want
                close();
            }
            else if (mCancelButton == field) {
                close();
            }
    }
    //this is for back button on device, when click pop this popupscreen
    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);
        } 
    

    Sorry I forgot to add hfm their.

    push this screen like below

    popupScreen _popupScreen = new popupScreen();
    UiApplication.getUiApplication () .pushModalScreen (_popupScreen);

    Thank you & best regards

    pp

  • How popup screen description on html?

    Location:

    After document. Write(), the application is stopped.

    Question:

    How popup screen description on html?

    You know that the following code is incorrect or other issues?

    Purpose:

    Display content on the screen.

    Minmum coding: (three methods are good to try, but fail)

    Method1

    function help() {}
    var myWindow = window.open (", 'Help', 'width = 600, height = 200');

    ...........stop here..........................
    myWindow.document.write(")

    To start

    ");
    myWindow.focus ();

    Methode2
    popup var = window.open (", 'Help', 'width = 600, height = 200');

    ...........stop here..........................
    var doc = popup.document;

    doc. Write(")

    To start

    ");
    }
    Method 3
    function help (id) {}

    var content = document.getElementById (id) .innerHTML;

    var generator = window.open (", 'name', 'height = 600, width = 200');

    ...........stop here..........................
    Generator.document.Write (')Popup');

    Generator.document.Write (')');

    Generator.document.Write (')

    This page

    ');

    Generator.document.writeln (content);

    Generator.document.Write (')');

    Generator.document.Close ();

    }

    If you know how to solve the problem, please let us know your suggestion or solution.

    Fight with the Playbook.

    Never (never never) use document.write. It can cause much more harm and confusion than good.

    If you want to display a dialog box that is customized with the text inside, the simplest is to use jQuery Mobile:

    http://jquerymobile.com/Demos/1.2.0-Beta.1/docs/pages/page-dialogs.html

    Otherwise, you can create your own by using a

    element with some custom CSS, like this

    HTML:

    this is my description

    CSS:

    .dialog {
       max-width: 30em;
       border: solid 0.25em black;
       background-color: #ddd;
       padding: 1em;
       display: inline;
       position: relative;
       left: 10em;
       top: 3em;
    }
    
  • How can I display an error message on the listening port close popup without closing the popup.

    Hi Experts,

    JDeveloper 12.1.3.0.0

    How can I display an error message on the listening port close popup without closing the popup.

    Thank you

    Roy

    As its name suggests, close listener of popup is called when popup is closed so you can not do this.

    If you want to display the popup message, use your own buttons instead of the ok/cancel default buttons and close the popup programmatically.

    Dario

  • Creating Popup screen without borders

    Hello everyone,

    I'm developing an application in which I use the pop-up screen.

    but the popup screen comes with white border by default.

    How do I remove the border pop-up screen white default.

    If possible can someone explain to me with the code snippet?

    Thanks in advance

    Hi Amit,

    I think this thread will be useful for you

    http://supportforums.BlackBerry.com/T5/Java-development/PopupScreen-with-transparent-background-and-...

  • List items are overlapped on popup screen

    Hi all

    I'm developing an application in which i use a popup screen and I have an ist of all data on the device (memory a sd card in the device). I show these data in a list and with a few images and checkboxes. My problem is that when I scroll or scroll through list items upward, are overlapped and yet when I scrolling to a particular element, only this element comes to its normal state.

    And this behavior is only broadcast on the devoce but when I run the same code on Simulator it works very well without any problems!

    Why this is happening? Any idea?

    Help, please!

    Thank you..

    Thnx for your help...

    My problem is solved...

    I was doing loads of operations under oaint method...

    Thank you very much...

  • Conditional call forwarding and popup screen.

    Hi all

    I push a pop-up screen to cover a call out with my own information. However on my device and several others, a pesky "conditional call forwarding" popup is displayed by the phone which briefly takes precedence over my popup screen. Is this anyway to prevent this.

    I push the screen by using the following code.

    UiApplication.getUiApplication().pushGlobalScreen(activeOutDialScreen, 0,UiEngine.GLOBAL_SHOW_LOWER) ;
    

    I tried setting the summary field on a few different things, but nothing can stop the pop-up conditional reference poster.

    Any help or just confirming, that it is not possible would be greatly appreciated.

    Kind regards

    Alan

    None

  • Popup screen problems

    I've tried using the search tool and google my whole day, but I can't seem to find the answer to these two problems.

    1. I'm positioning my pop-up screen in the middle of the screen. But as you can see in the image below it is nowhere near the Center.

    2. I'm trying to focus my two buttons in the middle of the popup screen with a verticalfieldmanager, but somehow it is fondant a position according to the width, I don't know what.

    Here is the code:

    private final static int _Width = 200;private final static int _Height = 200;private final static int _X = (Display.getWidth() - _Width) >> 1;private final static int _Y = (Display.getHeight() - _Height) >> 1;public class NetworkSettingScreen extends PopupScreen{
    
    public NetworkSettingScreen(){   super( new VerticalFieldManager());   LabelField lf = new LabelField("Network Settings", DrawStyle.HCENTER);    SeparatorField sf = new SeparatorField();         CheckboxField cbf1 = new CheckboxField(" WiFi", true);    CheckboxField cbf2 = new CheckboxField(" GPRS/Edge/3G", true);
    
      VerticalFieldManager vfm = new VerticalFieldManager(HorizontalFieldManager.FIELD_HCENTER);    ButtonField bf1 = new ButtonField("Save", DrawStyle.HCENTER); ButtonField bf2 = new ButtonField("Cancel", DrawStyle.HCENTER);   vfm.add(bf1); vfm.add(bf2);
    
      //add UI components to Pop-up screen  add(lf);  add(sf);  add(cbf1);    add(cbf2);    add(vfm);}
    
    public void sublayout(int width, int height){   super.sublayout(width, height);   setExtent(_Width, _Height);           setPosition(_X, _Y);}}//end of class
    

    http://i55.Photobucket.com/albums/G152/chengbang69/screenshot.jpg

    any help would be appreciated

    Hey chengbang69,

    I modified your code to obtain the expected results,

    final class NetworkSettingScreen extends PopupScreen
    {
        private final static int _Width = 200;
        private final static int _Height = 200;
        private final static int _X = (Display.getWidth() - _Width) >> 1;
        private final static int _Y = (Display.getHeight() - _Height) >> 1;
    
    public NetworkSettingScreen()
    {
        super( new VerticalFieldManager());
        LabelField lf = new LabelField("Network Settings", LabelField.FIELD_HCENTER);
        SeparatorField sf = new SeparatorField();
        CheckboxField cbf1 = new CheckboxField(" WiFi", true);
        CheckboxField cbf2 = new CheckboxField(" GPRS/Edge/3G", true);
    
        VerticalFieldManager vfm = new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER);
        ButtonField bf1 = new ButtonField("Save", ButtonField.FIELD_HCENTER);
        ButtonField bf2 = new ButtonField("Cancel", ButtonField.FIELD_HCENTER);
        vfm.add(bf1);
        vfm.add(bf2);
    
        //add UI components to Pop-up screen
        add(lf);
        add(sf);
        add(cbf1);
        add(cbf2);
        add(vfm);
    }
    public int getPreferredWidth() {
        return _Width;
    }
    public int getPreferredHeight() {
        return _Height;
    }
    
    public void sublayout(int width, int height)
    {
        super.sublayout(getPreferredWidth(), Integer.MAX_VALUE);
        setExtent(getPreferredWidth(), getPreferredHeight());
        setPosition(_X, _Y);
    }
    }//end of class
    

    The reason why you need to replace getPreferredHeight() and getPreferredWidth() is due to all subcalls and sublayouts which actually occur when you call super.sublayout. It will then use the 'default' screen page or getPreferredWidth/height.

    Just a friendly recommendation, adjusting the size of a screen to a static value is effective only if you also check the size of the font, currently if the user has a font above average size, a part of the text will not be seen, so, technically, the most effective way is to have the JAVA virtual machine to manage the resizing/flaking itself This can be done by simply using the same code that I posted above, however remove the substitution on sublayout, the width will be slightly larger that you set but at least you won't encounter unknowns.

    Hope this helps,

    Concerning

    André

  • Computer laptop screen locked after trying to download a free drawing software now can not deactivate or close the screen

    computer laptop screen locked after trying to download free software for drawing fast vector engineer tools and now the break is unable to calculate or close the screen

    Thank you

    Bill

    If your computer is bad, you need to do a system restore. Since it seems that you can not stop, try to hold the power button until it turns off. If this does not work, unplug (if laptop, remove the battery).

    From there on, allows to do a restore:

    1. turn the computer on and start to tap F8 to get the start menu
    2. Select repair your computer
    3. Select System Restore
    4. Follow the prompts

    If the restore point is older, feel free to use the Scan for affected programs feature to make sure that no other programs are affected. Otherwise, I would make a note of it, as it will have to reinstall these programs. In addition, I was running updated Windows once your system working again, since you will most likely use a restore point set up just before an update. (no point in re-opening of a security breach)

  • Close all screens?

    A few times I have much stacked... screen I'm able to hit the "back" button until I go back to the main screen of the application, but is there a way to close all screens and return to the main screen when I hit 'Hand' in my menu?

    Thank you!

    Try this:

    While (UiApplication.getUiApplication () .getScreenCount () > 1)
    {
    UiApplication.getUiApplication () .popScreen ();
    }

    Rab

  • close popup after download

    Jdev 11.1.1.7

    I have a poopup that has 2 buttons, download another file cancel as indicated:

    quest.png

    popup codes is:

    < af:popup id = "p3".

    Binding = "#{pageFlowScope.BeanName.downloadBulkRolePopup} '"

    contentDelivery = "immediate" >

    < af:dialog id = "d5" type = "id ="pgl29"layout ="vertical"nLayout >"

    < af:panelGroupLayout id = "pgl31" layout = "horizontal" >

    < af:spacer width = "30" height = "50" id = "s22" / >

    "" < af:selectOneChoice label = "Please select a Type" id = "soc4" autoSubmit required = "true" = "true" value = "".

    Binding = "#{pageFlowScope.BeanName.selectTypeSOC_binding}" >

    < af:selectItem label = 'G' value = 'G' id = "si7" / >

    < / af:selectOneChoice >

    < / af:panelGroupLayout >

    < af:panelGroupLayout id = "pgl30" layout = "horizontal" >

    < af:spacer width = "20" height = "50" id = "s23" / >

    < af:commandButton text = "download the role in bulk" id = "cb8.

    inlineStyle = "do-size: small;" do-family: Arial; make-weight: bold; ">

    < af:fileDownloadActionListener filename = "BulkRole.csv"

    contentType = text/csv"; "charset = utf - 8"

    Method="#{pageFlowScope.BeanName.OrgTypeBulkRoleDownloadCSV_ActionListener}"/ >

    < / af:commandButton >

    < af:spacer width = "40" height = "50" / >

    < af:commandButton text = 'Cancel' id = 'commandButton5' immediate = "true".

    inlineStyle = "do-size: small;" do-family: Arial; make-weight: bold; »

    actionListener="#{pageFlowScope.BeanName.cancelDownloadActionListener}"/ >

    < / af:panelGroupLayout >

    < / af:panelGroupLayout >

    < / af:dialog >

    < / af:popup >

    Cancel of works well as:

    {} public void cancelDownloadActionListener (ActionEvent actionEvent)

    this.getDownloadBulkRolePopup () .hide ();

    }

    But when calling () .hide () this.getDownloadBulkRolePopup; for the download after the download code button, it does not close the pop-up window as expected

    Please notify

    This is because fileDownloadActionListener calls internally the responseComplete(); and you can't do anything after that

    So use this way:

    http://www.gebs.ro/blog/Oracle/affiledownloadactionlistener-generate-export-and-close-popup/

  • I'm working with Acrobat XI and when I try to add text to the geopdf file I get a popup screen that says it is a secure document and editing is not allowed. How can I fix it?

    I'm working with Acrobat XI and when I try to add text to a geopdf file I get a popup screen that says it is a secure document and editing is not allowed. How can I fix it?

    I thought about it... need to use the defined comment tool, not the set of editing tools.

Maybe you are looking for

  • Internal mic has stoped working

    The internal mic on my computer laptop HP Pavilion touchsmart has stoped working.  Nobody can hear me on Skype and I can't make recordings on other programs, so I know its not only Skype.  How can I get that back?

  • Can't find a driver for Geforce 420 GB (32 MB) - Satellite 2410

    Hello I have a Toshiba 2410-S504 and I have trouble finding drivers for my nVidia Geforce 420 Go graphics card! The one on the nVidia site does not install (if I force installing them it restarts with a blue screen) and later a found on the Toshiba s

  • HP 251-a244: power &amp; potential installation sound card or chart?

    I've got a new desktop HP 251 - a244, window 10 edition 64-bit, AMD-A6-6310, integrated graphics AMD Radeon R4 card, 6 GB DDR3 - 1600 MHz RAM, 1 TB SATA HDD, Realtek RTL8188EE 802.11 b/g/n WiFi Adapter, Realtek RTL8106E-CG 100BASE-T Ethernet (1 port)

  • W700 downgrade to XP pro 32 bit

    Hey everybody, I've demoted the w700 vista toxp pro. After you downloaded and installed all the drivers on the lenovo support site, everything works. It's anything but the wacom digitizer. He worked before the downgrade, so it should be good hardware

  • 2012 AVG Internet Security.

    I recently installed AVG 2012 Internet Security on an experimental basis and then uninstalled, but my Security Center indicates that AVG 2012 is the anti-virus program and a firewall active.  How can I solve this?  I find all the files AVG or left on