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.

Tags: BlackBerry Developers

Similar Questions

  • Report opens in the dialog box, on the client.

    Hello

    I use 11.1.2.1.0 Builder, and I'll call you a form report.

    If I run/call report on my pc it opens perfectly in the browser (pdf format), but if the same report opens on the client pc, it opens the dialog box save as and request the user to save the report.

    Can you please let me know, how can I achieve to open a report in the browser on the pc of the client, without saving it in the logon dialog.

    Looking forward to your answers.

    Kind regards

    It is probably because the browser does not support opening a pdf document.

    Most browsers support pdf, some need a plugin. Check what is happening with any other pdf document on the web you want to open on PC of the user, as http://docs.oracle.com/cd/E16655_01/server.121/e17643.pdf

  • 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

  • Problem writing to XML after the dialog box

    I use ScriptUI to create and update XML in a document (using the Document.XMLElements methods).

    Before opening a ScriptUI window, I can read and write XML without problem.

    But after opening a window with some ScriptUI resources, I can only read the existing XML BUT NOT WRITE!

    My write method is called by a key event:

    ...

    var myXMLRootNode = / * instantiated * /.

    ...

    myWindow.okButton = / * instantiated * /.

    ...

    myWindow.okButton.onClick = function() {myXMLRootNode.xmlElements.add (myTag, object)};

    myWindow.show ();

    ...

    It seems that the onClick callback works OK for reading (I can recover all existing values without problem), but not for writing.

    Any idea?

    Hey!

    Well, the thing is that you must close the dialog before first in writing in order to document.

    myWindow.okButton.onClick = function(){myWindow.close(1);};
    
    var myWin = myWindow.show();
    
    if(myWin == true){
        myXMLRootNode.xmlElements.add(myTag, object);
    }
    

    I hope that helps!

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • Program returns to the classic theme after the dialog box

    I have several programs c ++ which works very well under Vista (Basic or is this Aero mode?).  If a dialog box is in the main program and then closed, the theme of the window window main classic Exchange just after the window is moved/size/minimized or disabled/enabled etc.  I used SPY to try and see if it tells me about this, but don't see anything.  Can shed you some light on this please?

    Ash

    Post the same question in the MSDN forums, which will be the forum for this type of creative problems.

    http://social.msdn.Microsoft.com/forums/en-us/home

  • [CC/CC2014/Mac] How to prevent the dialog box to hide

    Hi all

    I have a Connect dialog box to my plugin. When the connection is asuccess, I show an error alert box to the user. After that, when the user closes the alert dialog box, the dialog connection must still be in its place and user can try to log in again. It works absolutely fine until the CS6. But in CC2014 strange thing happens.

    When the user closes the error alert box, my connection dialog box just disappears! In fact, it becomes invisible since the closure, all options of InDesign becomes invalid as if a dialog box opens and I have to close the application with the activity monitor. I don't know why this phenomenon occurs? (I did nothing special to my Controller dialog box)

    The following simple code has worked before-

    void MyLoginDialogObserver::Update(const ClassID& theChange, ISubject* theSubject, const PMIID& protocol, void* changedBy)  {
      if (theChange == kTrueStateMessage) {
           InterfacePtr<IControlView> controlView(theSubject, UseDefaultIID());
           ASSERT(controlView);
           if (controlView) {
                WidgetID widgetID = controlView->GetWidgetID();
                switch (widgetID.Get()) {
                     case kOKButtonWidgetID: {
                        if (Login()) {
                             // login is successful
                            CDialogObserver::Update(theChange, theSubject, protocol, changedBy);
                        }else{
                             // login failed! 
                             CAlert::InformationAlert("Login Failed!");
                             //THE DIALOG SHOULD REMAIN OPEN after the alert box is closed, but it just vanishes!
                        }
                        break;
                     }
                     default : {
                          CDialogObserver::Update(theChange, theSubject, protocol, changedBy);
                          break;
                     }
                }
           }
      }
    }
    

    Any help will be very appreciated!

    Move this login()) for your DialogController::ValidateDialog ().

    BTW, your comment should invoke the Update() inherited in all cases unless it consumes a specific notification, such as a widget in private.

    And for the removal of the OK button you really should know what you're doing.

    Dirk

  • Create a Listbox control in the dialog box

    I want to create a simple list box in a dialog box and fill it with some dynamic ropes. I placed a Treeview in the dialog box by using this code in the file en:

    TreeViewWidget

    (

    myListID, / / fWidgetId

    kSysStaticTextPMRsrcId, / / fRsrcId, fRsrcPlugin

    kBindNone,

    Frame (10, 10, 280, 200),

    kTrue, / / fVisible

    kTrue, / / fEnabled

    kTrue, / / fEraseBeforeDraw

    kInterfacePaletteFill, / / InterfaceColor wipe

    "", / / control label

    kFalse, / / display root node

    kFalse, / / use scroll bar:

    kTrue, / / use scroll bar V

    20, / / button vertical scrolling increment

    20, / / inch vertical scrolling increment

    0, / / scroll button horizontal increment

    0, / / inch horizontal scrolling increment

    1, / / selectable items, 0 = no selection, 1 = single selection, 2 = Multiple selection

    kTrue, / / of many parents to choose a toy

    kTrue, / / allow the discontinuous selection

    {

    }

    )

    In my box, I see the list box with entries 0-9. How can I remove these entries and add my own strings? In PanelTreeView and other samples, I can not find a solution.

    In DialogController::InitializeDialogFields I tried to init the list like this without effect:

    TreeView IControlView * = pPanelData-> FindWidget (myListID);

    ITreeMgr InterfacePtr < ITreeViewMgr > (treeView, UseDefaultIID();

    iTreeMgr-> ClearTree (kTrue);


    TreeView in cs6 is the only possibility for the creation of a ListBox with selectable inputs a Dropdownlist control is no option because the user should see several entries after the dialog box.

    Node NodeID = treeviewHierarchyAdapter-> GetNthChild(rootNode,0)

    treeviewController-> Select (node, kTrue, kTrue);

  • 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

  • Why don't I have easily select my questions open after the connection support?

    Why don't I have easily select my questions open after the connection support?

    When I connect support communities, I have still no clear idea where to find my support questions which remain open to check updates.

    Seems to me that this should be a great, distinct and separate button on the homepage of support after you have connected.  "My open issues Apple Community Support."

    Is this too much to ask?

    Steve

    1. Click / tap your username
    2. Click / tap 'manage subscriptions '.

  • Firefox does not open after the update. Cannot open the profile technical, even when you use the directory in cmd line path

    I'm using Firefox on a Windows 7 computer. Firefox does not open after the last update. I read the help articles and it seems that I need to create a new profile because my settings were probably corrupted. I'm unable to open the profile technical, even when you use the directory in cmd line path. I tried the following commands in the command line:

    Firefox Pei
    "C:\Program Files (x 86) \Mozilla" PEI

    Nothing happens with every order.

    I am also running Norton Internet Security. I read a help of virtual navigation features Re article that can cause a problem. The article says to check the setting of virtualization in the internet security software and to clear the virtual cache. I went through all the menus of settings in Norton Internet Security version 21.6.0.32 and I don't see anything that looked like in "virtualization" settings, so I guess that does not apply to me. "

    If you have any ideas, I had appreaciate that your expertise!

    Hello arcandl, at the launch of the firefox is not after you double-click the shortcut, it is sometimes also a sign of active malware on a system.
    you might want to try running a scan with some various other security like the free version of malwarebytes and adwcleaner tools that are specialized to remove the adware and browser hijackers.

    Fix Firefox problems caused by malicious software

  • My right click menu is missing after the use of security of Kaspersky application control settings.

    Right click menu disabled

    My right click menu is missing after the use of security of Kaspersky application control settings.

    My right click menu is missing after the use of security of Kaspersky application control settings.

    This tutorial will help?

    Context menu - enable or disable

    http://www.Vistax64.com/tutorials/140508-context-menu-enable-disable.html

    Option One is the easiest.

  • When I try to open after the effects of a window appears saying alert last log message was: &lt; 140735110578944 &gt; &lt; BEE_work queue &gt; &lt; 5 &gt; main thread of stacking: 524288 log crash generation may take a few minutes

    When I try to open after the effects of a window appears saying alert last log message was: < 140735110578944 > < BEE_work queue > < 5 > main thread of stacking: 524288 log crash generation may take a few minutes. Help, please

    Contact Adobe support.

  • Windows 7 does not open after the updates installed

    Help, please. Computer my son makes the automatic updates today and now it does not start. It takes me to the blue Windows screen then appears a box that says "System Recovery Options". It has two options

    Recovery tools 1-use by choosing an operating system (no present in the box). I tried this one and it did not work.

    2. restore your computer using a system image, which does not either even though I know he created images of system. Please any information would be greatly appreciated.

    Once I try these options from the dialog box get, with startup repair, System Restore, system image recovery, Windows memory Diagnostic and invites but not these wil do anything either.

    What can I do so that he could start over again what can I remove updates?

    Hello

    Disable automatic restart your computer and check if there are errors displayed when the computer does not start. To disable automatic reboot follow the link below.

    http://Windows.Microsoft.com/en-us/Windows7/advanced-startup-options-including-safe-mode

    Try the steps suggested by David Y post dated November 2, 2010 in the link given below and check if that helps.

    http://social.answers.Microsoft.com/forums/en-us/w7repair/thread/a6071159-db22-4076-b5d8-31f446dbdf32

    Hope this information is useful.

    Amrita M

    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • 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.

  • Could not open the dialog box of .msi files saying find a program to open the file type

    In time, I used msi files to install many programs. But I know longer really since then, msi files could not open. Now, I can't open the msi installer, which I had used to install programs. When I click on the msi file, it displays a dialog box saying find a program to open the file type.

    Hello

    1. Were there some recent changes to the computer before the show?

    Method 1: I suggest you unregister and re - register the windows setup program and check if that helps you. To do this, please follow the steps below:

    Unregister and register the Windows Setup program again

    (a) click Start, click run and then type cmd in the dialog box, and then click command prompt.

    (b) at the command prompt, type the following and press ENTER after each line:

    MSIExec /Unregister

    MSIExec/regserver

    Method 2: When you run an .exe on a Windows XP, Windows Vista or Windows 7 computer file, the file can start another program.

    http://support.Microsoft.com/kb/950505/

    Method 3: Change default programs using Set Program Access and computer defaults:
    http://Windows.Microsoft.com/en-us/Windows7/change-default-programs-using-set-program-access-and-computer-defaults

    Changing the programs Windows uses by default: http://windows.microsoft.com/en-US/windows7/Change-which-programs-Windows-uses-by-default

    Hope this information is useful.

Maybe you are looking for