After closing the dialog box screen, menu by default is displayed

I have a simple program that consists of a screen and a button. When the button is clicked, it displays a dialog box in the button handler. Once the dialog box is closed, the parts of the menu are displayed. Very strange.

Here's the code that displays the dialog box:

public void fieldChanged( Field field, int context )
    {
        String label = "";

        if ( field instanceof ButtonField )
        {
            label = ((ButtonField)field).getLabel();
        }

        //if this was the login button, display the popup.
        if ( label.equalsIgnoreCase( "Login" ) )
        {
            String icon = "questionmark.png";
            Bitmap bitmap = Bitmap.getBitmapResource( icon );
            String [] options = new String [] { "Yes", "No", "Cancel" };
            int [] optionIndexes = new int [] { Dialog.YES, Dialog.NO, Dialog.CANCEL };
            Dialog dialog = new Dialog( "Select an option", options, optionIndexes, optionIndexes[2], bitmap );
            dialog.doModal();

        }

    }

Once the dialog box is closed, this is:

I have no idea why this show after the closure of the dialog box. Any ideas?

Well done

I think that many people would find answers to their questions if they tried harder with search.  And you find faster as well!  And whenver I creative search, I usually find something else useful that I was looking for.  Kind of like Google where you can go off on a complete tangent...

In any case, can mark you this as resolved?  See you soon

Tags: BlackBerry Developers

Similar Questions

  • How to use a button in a dialog box without closing the dialog box

    I defined a button located in a dialog box. I want this button to refresh an outputText but when clicked, the managed bean method is called as expected and the dialog box is closed that I don't want.

    <af:popup id="dataFilterPopup">
      <af:dialog id="d5" contentHeight="500" contentWidth="600" stretchChildren="first">
      <af:panelGroupLayout layout="vertical">
      <af:commandButton text="Count" id="cb1" action="#{pageFlowScope.ReportDataFilterBean.count}" partialSubmit="true" partialTriggers="countText"/>
      <af:outputText id="countText" clientComponent="true" value="Number: #{pageFlowScope.ReporDataFilterBean.countValue}"/>
      </af:panelGroupLayout>
      </af:dialog>
    </af:popup>
    

    The managed bean counting method sets the value of the countValue.

    public void count() {
     countValue = 10;
    }
    
    public int getCountValue() {
      return countValue;
    } 
    

    I see two errors:

    1. you may use the 'action' of attribute because it causes the navigation there is no transition rule such that the current page is just refreshed, so your dialog box is closed. Use 'actionListener' rather;

    2. in order to refresh the component, you must set the 'partialTriggers' attribute but not the attribute 'partialTriggers' the command button:

    Dimitar

  • I accidentally closed the dialog box when Firefox was asked if it was OK for a program to change my computer. Now, I can't open the program.

    I have a game (Neverwinter Nights) that updates periodically. Yesterday, I got a dialog box asking if it was OK for game to change my computer (happens from time to time). I meant to click 'Yes', but instead accidentally closed the box (which I think will remain always to 'no'). Now, I can not open the game. How can I fix?

    Hello stmanley1970, these dialog boxes are not from Firefox, but your windows operating system 7. Therefore, please contact support for this game publisher channels to receive help for that matter...

  • A screen popup menu is opened after the closure of the dialog box

    Hello

    I have a test application with a screen containing a button.

    When I click on the button (pressing the button on my BlackBerry 9220 trackpad), it opens a dialog box.

    Then when I press ESC to my BlackBerry 9220, it closes the dialog box and I'm back on my screen.

    Now, if I add to my screen, a menu item, the changes in behavior:

    When I click on the button (pressing the button on my BlackBerry 9220 trackpad), it opens a dialog box.

    Then when I press ESC to my BlackBerry 9220, it closes the dialog box and opens a menu screen.

    So, I would add my item of menu but keeping the old behavior of my application after you close the dialog box.

    Any idea?

    Thank you.

    Best regards.

    Here is the code:

    Import net.rim.device.api.ui.UiApplication;
    Import net.rim.device.api.ui.component.ButtonField;
    Import net.rim.device.api.ui.component.Dialog;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.Field;
    Import net.rim.device.api.ui.FieldChangeListener;
    Import net.rim.device.api.ui.MenuItem;
    Import net.rim.device.api.util.StringProvider;
    SerializableAttribute public class TestApplication extends UiApplication
    {
    public TestApplication()
    {
    this.pushScreen (new TestScreen());
    }
    Public Shared Sub main (String [] args)
    {
    Application TestApplication = new TestApplication();
    application.enterEventDispatcher ();
    }
    }
    final TestScreen class extends FieldChangeListener implements screen
    {
    public TestScreen()
    {
    / * MyMenuItem MenuItem = new MenuItem (new StringProvider ("my menu item"), 0 x 230000, 0); * /
    ButtonField myButtonField = new ButtonField ("button my field");
    myButtonField.setChangeListener (this);
    This.Add (myButtonField);
    / * this.addMenuItem (myMenuItem); * /
    }
    ' Public Sub fieldChanged (field field, int context)
    {
    Dialog.Alert ("test");
    }
    }

    Here are a few screenshots:

    It comes from the popup menu. create the button with CONSUME_CLICK would be the simplest solution.

  • I am expierencing problems with my isight Camera on my MacBook Pro. Suddenly the video camera does not start (no green light on) FT or Photo Booth. The screen is black, if I restart computer it works but after closing the lid, it stops. V10.11.3

    I have problems with my view i camera on my Mac Book Pro. Suddenly the video camera does not work (no green light on) FT or Photo Booth. The screen is black, if I restart it, it works but after closing the lid it stops and I have to restart the computer.  I use V10.11.3. An idea about what is happening

    Hello mpm068,

    Thank you for using communities of Apple Support.

    Since your iSight webcam works up to the time that your Mac goes to sleep, I would like you to start please help desk trying to replicate this problem then to reboot in safe mode:

    1. Choose the Apple menu > shut down.

    2. After your Mac stops, wait 10 seconds, then press the power button.

    3. As soon as you hear the startup tone, hold down the SHIFT key.

      You must press the SHIFT key as soon as possible once you hear the startup tone, but not before.

    4. Release the SHIFT key when you see the gray Apple logo and progress indicator.

    To exit safe mode, restart your Mac, but no press during the startup.

    OS X El Capitan: start in safe mode

    Take care.

  • How to freeze my application until the dialog box is closed?

    Hi everyone, I wonder how to freeze my application until the dialog box is closed.

    Please look at my code first:

    inputDialog=new InputReadMessageNumberDialog(selectedGroup.getName(),msg,numPost,choices,values);
    UiApplication.getUiApplication().invokeLater(new Runnable()
    {
      public void run()
      {
       inputDialog.show();
       if(inputDialog.doModal()==Dialog.OK){
       System.out.println("FROM: " + inputDialog.getFrom()+" TO:"+inputDialog.getTo());
       }
      }
    });
    

    As I throw the runtime exception, then I tried to do this:

    inputDialog=new InputReadMessageNumberDialog(selectedGroup.getName(),msg,numPost,choices,values);
    UiApplication.getUiApplication().invokeLater(new Runnable()
    {
      public void run()
      {
       inputDialog.show();
    
      }
    });while(true){  synchronized(this){    if(inputDialog.isClosed) break;    else wait(500);  }}if(inputDialog.doModal()==Dialog.OK){
    System.out.println("FROM: " + inputDialog.getFrom()+" TO:"+inputDialog.getTo());
    }
    

    She also throws an exception too. Now I don't know how to solve this problem.

    Any ideas?

    Thank you!

    Steve

    While I have deep religious convictions against the complicity of an author of the modal dialog box,

    I can say that this code seems to work and these dialog box classes are easy to use. If you

    Look at the API these altneratives will be pretty obvious.

    but there are two usages mixed with a be commented (both

    Work as much as I KNOW).

    String [] ch = new String() {"ACCEPT", "REJECT"};
    int [] vx is new int [] {Dialog.YES, Dialog.NO};.
    D = new dialog box dialog (m_tc, ch, vx, vx [0], new Bitmap (1,1));
           
    D = new dialog box dialog box (Dialog.D_YES_NO, m_tc, Dialog.NO, Bitmap (1,1), 0) new;
    F = d.getFont (police);
    d.setFont (f.derive (Font.PLAIN, f.getHeight () - 1));
    int x = d.doModal ();

    This will block your thread until there is something to "xx."

    However, I must reiterate that you evaluate the options before deciding that you need

    to lock all the other options. This is especially true in this environment where things

    might take some time and resources are limited.

    If you want to hang your entire application, no doubt you

    can define a volatile indicator around the doModal call and have other threads check it.

  • I get my serial number and click on 'Download', then the dialog box says 'unavailable screen '.  What the devil?

    I get my serial number and click on 'Download', then the dialog box says 'unavailable screen '. What the devil?

    Please access the following link to download the installer of Photoshop elements 14. If you're still having problems, try to please the link to Chrome or Firefox and check if it downloads.

    Download Photoshop Elements | 10, 12, 14, 11, 13

    Thank you.

  • Adobe prelude CC - can't see ingest the dialog box after you have double clicked on to ingest

    I'm having a problem with Adobe prelude, version 2015.0, 4.0.0 (Build 138), which is the most recent version at the moment. I use Windows 7 Professional. My problem is this: when I click on "Double click to interfere", I never see ingest the dialog box appear. I have multiple monitors, but I do not see the dialog box on any of these screens and I don't see anywhere on the taskbar. At this point, if I try to click anywhere in the application, it gives me a sound of ding as if the dialog box was opened. Then I have to use the Task Manager to close the application. Restart the PC does not help. I even uninstalled Creative Director Cloud prelude, rebooted, and then reinstalled the application, and the problem persists. Prelude used to work just fine for me until about a week ago. Help, please. Thank you!

    [Left the forum Cloud/Installer generic for program specific forum... MOD]

    -Very well, so I just solved my own problem. I noticed that if I try to ingest video prelude on a different Windows user account, the problem moved, led me to believe that I lived a matter of preferences of the Windows user. The solution was to press Windows key + left or Windows Key + right to restore the location of a window of the application to its default value. Problem solved!

  • I'm trying to reduce the file size of a jpeg file, but the dialog box under image &gt; image size reflects a much smaller that the file is. I saved the image after resampling and by reducing the size of the image, reduced the pip to 72 and lowered the qua

    I'm trying to reduce the file size of a jpeg file, but the dialog box under image > image size reflects a much smaller that the file is. I saved the image after resampling and simplistic image, the pip size reduced to 72 and lowered the low quality only to see the minimum file size reduction. Why the dialog box in photoshop gives me a different file size than my computer and how do I solve this problem? Thank you!

    The Image Size dialog box dialog box shows the uncompressed size.

    Your operating system (Explorer/Finder) shows the size compressed. (size on the disk)

    If you use save for Web, you can see the compressed size, but also an overview.

  • All the menu items disabled in the dialog box, very well in the palette

    Hey,.

    I have to use a treeview in a palette and can add/remove columns with a right-click menu on the headers. This set works very well in a palette, but when I use the same treeview in a dialog (kDialogBoss), all the items are disabled. Even if I add the stock with "kAlwaysEnabled" they remain disabled. With "kCustomEnabling" "UpdateActionStates()" call is not made, but the path is very well. What can be the problem here? I couldn't find a sample menu in the dialog boxes.

    Thanks for the help!

    Use kAlwaysEnabled. kEnableEvenDuringDialogs

    Dirk

  • The mouse pointer jump at the top of the screen when the dialog box opens

    In the last few weeks my mouse pointer jumps sometimes extreme high (left side) of the FF browser window. Only happens in FF, Chrome or IE or any other application from Ms. The mouse to update drivers fees Reloaded, switched mouses, USB switch, ports switched to a mouse not MS - all to nothing does.

    "It seems to happen most often when I mouse ' snap to" feature is turned on and that the pointer automatically moves to the default button in the dialog box.

    This unique disability FF to hide the pointer when you enter (when the value in the mouse properties box) have become very annoying.

    Please address and solve the two problems above. Thank you.

    Good news! Now come on. For the moment, you can disable
    KeyScrambler. You can always turn it on when you need it.

  • How to close the dialog box after pressing the button

    Hello. I added the button

    ButtonWidget

    (

    kButtonWidgetID,

    kSysButtonPMRsrcId,

    kBindNone,

    334, 434, 16, 16 + 24,

    kTrue, kTrue,

    kButtonLabelKey,

    ),

    and in my method in the file... Observer.cpp

    If (theChange is kTrueStateMessage)

    If (theSelectedWidget is kButtonWidgetID)

    This I want close dialogue

    How? I don't want to create CancelButtonWidget. It is must be cutom button.

    Try this in your dialogObserver,

    InterfacePtr myParent (this, UseDefaultIID());

    InterfacePtr ((IDialog*) myParent-> QueryParentFor (IID_IDIALOG)); dialog

    If the dialog box (dialogue)-> Close();

  • March 2011 the dialog box print Adobe recently becomes too big

    RECENTLY, possibly after agreeing an Adobe upgrade, I can no longer access the button 'ok' in the print dialog box. The box is too large to be completely visible.   What should I do to make things for the parameters I used a couple of weeks.  I made NO changes.  I've printed PDF files recently, cannot now.

    Thanks to a few simple, easy to follow help.

    Hello

    1. what upgrade Adobe do you have installed?

    2. not this problem only occurs when you try to print from Adobe?

    a. you can resize the dialog box by going into a corner and get the arrow to decrease the size of the dialog box.

    b. you can also change a smaller screen resolution to see if that helps.

    Check out the link:

    Change your screen resolution

    http://Windows.Microsoft.com/en-us/Windows7/change-your-screen-resolution

    c. also, you can use your scroll button and hold down the ctrl key at the same time. It changes your whole screen turned to more or less important.

    You can also visit the Adobe support links and check if it helps:

    Resolve PDF printing problems. Acrobat, Reader

    http://kb2.Adobe.com/CPS/873/cpsid_87346.html

    http://forums.Adobe.com/thread/391730

    Hope this information is useful.

  • Problem with dismissing the dialog box

    Hello world

    This is my first post here. Sorry if the question is very simple...

    I need to download an image on server. I display a dialog box to confirm if the file should be downloaded.

    Everything works well except that the dialog box is dismissed after that the whole process is over. I know I'm missing something-related threads. pls help me to understand.

    Here is my code:

    public void fieldChanged(Field f, int context) {
        if (f == addButton) {
                        FileSelectorPopupScreen fps = new   FileSelectorPopupScreen();
            fps.pickFile();
            theFile = fps.getFile();
    
            if (theFile == null) {
                Dialog.alert("Screen was dismissed.  No file was selected.");
            }
            else {
                UiApplication.getUiApplication().invokeAndWait (new  Runnable(){
                public void run(){
                    int confirmationResult = Dialog.ask(Dialog.D_YES_NO, "Do you                    want to upload?", Dialog.YES);
                    if (confirmationResult==Dialog.YES) {
                             status=1;
                    } else {
                             status=0;
                    }
                }
              });
    
            }
    
            if(status==1){
                Thread t= new Thread(){
                    public void run(){
                        //MY CALL TO WEBSERVICE                     }
                }};
    
                try{
                    t.start();
                    t.join();                                           refreshData(); //call to method to post the image data to server                        //and refresh the screen with new image
                }
                catch(Exception e){
    
                }
    
                }
            }
    
        }
    

    My problem is that the I selected YES the dialog box only after the call to webservice licensees are completed and the image is published on the server and the screen is refreshed with the new image.

    Let me know what I'm missing.

    Welcome to the forum!

    Correctly, you start the process of network on a separate Thread.  Then you attach the wire event for this Thread by using the following instructions:

    t.Start ();
    t.Join ();

    So you give up the thread of events not until your networking activity has finished.  It does not block your event feed so that your application will become unresponsive to the user and as you noted, activities requiring feed event, such as the removal of your dialog box, cannot occur.

    You must reprogram your treatment so that the activity of the network as a completely asynchronous operation.  You can't wait on this.  You should get to tell you when it has finished.  I suggest that looking at the observer model during the implementation of this process.

  • Retrieve the value of the dialog box

    Hello

    I have a class that extends the dialog box. A few Radiobuttns are added. I want to get the value of the RadioButton selected the actual class of the screen, call the dialog box by clicking the Dialog.OK button. The code I tried is as follows:

    My class of the screen:

                    XXXDialog clScrn = new XXXDialog ();
                    if (clScrn.doModal() == Dialog.OK) {
    
                        // I click Ok, but this is never shown
                        Dialog.alert("Closed & here");
                        Dialog.alert("Selected = " + clScrn.getSelectedItem());
                    }
                    clScrn = null;
    

    The dialog class-

      public XXXDialog() {
            super(Dialog.D_OK, "Select Item", Dialog.OK, null, VERTICAL_SCROLL | VERTICAL_SCROLLBAR | Field.USE_ALL_WIDTH | Field.USE_ALL_HEIGHT);
            rbg = new RadioButtonGroup();
            rb1 = new RadioButtonField("One", rbg, false, Field.USE_ALL_WIDTH);
            rb2 = new RadioButtonField("Two", rbg, false, Field.USE_ALL_WIDTH);
    
            rb1.setChangeListener(this);
            rb2.setChangeListener(this);
    
            add(rb1);
            add(rb2);
        }
    
        public void fieldChanged(Field f, int context) {
    /*
    Actually, I want to know which field was clicked RadioButton or Ok button. If it is Ok, then I want to hide and return back to screen.
    */
    
            try {
                    RadioButtonField fd = (RadioButtonField) f;
                    item = fd.getLabel();
                    System.out.println("Selected = " + item);
            } catch (Exception e) {
            }
    
            try{
                ButtonField fd = (ButtonField) f;
                System.out.println("********* Button PRESSED = " + f);
                this.close();
            } catch (Exception e) {
            }
    
            System.out.println("*********** Field Count = " + f.getManager().getFieldCount() + " Index = " + f.getIndex());
        }
    
        public String getSelectedItem() {
            return item;
        }
    

    The XXXDialog class is in a separate file of java.

    Can anyone help me on what to do and how to achieve the goal.

    Thank you

    I found my solution. What I did is: -.

    In my main screen, I call the as dialog box

    clScrn.doModal ();

    Dialog.Alert (Come Back here");   I see this alert as soon as the dialog box is closed.

    In my class of dialogue, I have only the Ok button, dialog can be closed using the ESC key as I implemetned the code-

    Dialog box does not close on ESC
    {} public boolean keyChar (key char, int status, int time)
    Boolean retVal = false;
    {Switch (Key)}
    case Characters.ESCAPE:
    break;
    }
    Return retVal;
    }

    So now, there is no other means to close the exception, Ok button dialog box and I make sure that when Ok is clicked, 1 radiobutton is selected.

    Thank you all for the time and effort.

Maybe you are looking for

  • How can I get rid of the annoying "FLOW PLAYER'?

    On a website, when I go to him, to the top in the left corner, a pop-up for the feed reader rises, and it does not allow the site content to display.I ran my anti-virus program, as well as the anti-malware program, and nothing came.It only occurs whe

  • Which driver Apple opens the door to disc in Windows 10?

    Which driver Apple opens the door to disc in Windows 10?  I have a Mac Pro 64 bit and updated since Windows 8.1 for Windows 10.  I've updated the Boot Camp Assistant support files and the door does not open.  I do not use the player a lot more, but i

  • printer locked up with a print job

    I use an "old" j6400 printer and I have a job in Quebec City and I can't print, nor can I cancel the job... any ideas on how to clear Quebec?

  • My mailbox Flagged shows no mail

    I recently changed my email providers. I saved some notes in MY MAC but failed to move some messages with indicator on the hard drive. The Flagged mailbox shows that there are a number of Flagged messages. However, when it does not display messages.

  • How to upgrade RAM on a laptop ES1-512

    I read the upgrade of RAM is available for this laptop, even if it has no plate rear common access to may other portable. I guess the entire back must be removed. Anyone else done this and been able to point me in the right direction. Thank you Dave