If function on ObjectChoiceField working incorrectly.

Hi, I want my code to say, when selectedValue = 1 goto Page 1 when selectedValue = 2 goto myScreen. But when I select one of the options the ChoiceField and press my button, they always goto Page 1 and I don't know why.

Thanks for your help.

Max.

String choices[] = {"1","2","3","4","5","6","7"};
    ObjectChoiceField objsel = new ObjectChoiceField("Select a Chapter",choices,0);
    hfm2.add(objsel);
    add(hfm2);

    final String selectedValue = choices[objsel.getSelectedIndex()];
    ButtonField mySubmitButton = new ButtonField("Go To Chapter",ButtonField.CONSUME_CLICK);
    hfm.add(mySubmitButton);
    add(hfm);

    mySubmitButton.setChangeListener(new FieldChangeListener(){
        public void fieldChanged(Field Field, int context){
            if(selectedValue.equals("1"))
            {
            Page1 page1 = new Page1();
            UiApplication.getUiApplication().popScreen(Ui.getUiEngine().getActiveScreen());
            UiApplication.getUiApplication().pushScreen(page1);
            }

            else if(selectedValue.equals("2"))
            {
            MyScreen myScreen = new MyScreen();
            UiApplication.getUiApplication().popScreen(Ui.getUiEngine().getActiveScreen());
            UiApplication.getUiApplication().pushScreen(myScreen);
            }

        }});

you set the value of selectedValue outside your fieldChangeListener.

Tags: BlackBerry Developers

Similar Questions

  • My search function does not work in Windows 7 / MS Office 2010 more.

    I have W7 and MS Office 2010.  My search function has stopped working in Outlook first and then in Solution Explorer.  The only research that works within a Word or Excel document.  Explorer and Outlook is not even 'Act' as it is to the search or the other!  How can I fix it?  I prefer not to make W7 & 2010 uninstalling and reinstalling?  Please help :)

    Hi Susan,.

    Thanks for posting this question in the Microsoft Community.

    1. what security software is installed?

    2. don't you make changes to the computer before this problem?

    Let us try these methods.

    Method 1.

    Start the computer in safe mode and run a full scan of computer viruses.

    Advanced startup options (including safe mode): http://windows.microsoft.com/en-US/windows7/Advanced-startup-options-including-safe-mode

    Run a full scan of the computer with the Microsoft Safety Scanner to make sure that the computer is virus-free.

    Microsoft safety scanner: http://www.microsoft.com/security/scanner/en-us/default.aspx

    Warning of Security Scanner: there could be a loss of data while performing an analysis using the Microsoft safety scanner to eliminate viruses as appropriate.

    Method 2.

    You can run this fixit and check if that helps.

    Fix Windows Search when it crashes or shows no results: http://support.microsoft.com/mats/windows_search

    Open the search and indexing Troubleshooter: http://windows.microsoft.com/en-US/windows7/Open-the-Search-and-Indexing-troubleshooter

    Additional information.

    Improve Windows searches using the index: frequently asked questions: http://windows.microsoft.com/en-US/windows7/Improve-Windows-searches-using-the-index-frequently-asked-questions

    Method 3.

    I suggest that you can exercise SFC scan and check if that helps. The SFC/SCANNOW command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions.

    For more information how to make SFC / scan scan under Windows Vista and Windows 7, please follow this link: http://support.microsoft.com/kb/929833

    Let us know if you need assistance with any windows problem. We will be happy to help you.

  • Someone else has volume function keys stop working?  If so, I know a fix?

    Sometimes, my function keys stop working.  The small volume box appears and the volume is shown to change but there is no real effect on the volume.  Anyone know a fix for this other than to restart the computer?

    you have speakers connected, secure, powered?

    helmet?

     > System Preferences > Sound

    What is your output on?

  • Search by name function does NOT WORK.

    Before reading further, make a note of this: I have ALREADY installed the add-on "Search by name", and it DOES NOT WORK. By result, please do not suggest this add-on as a solution to my problem, since the module IS my problem.

    I used Firefox ESR 10.0.11 and was forced to switch to 17.0.7 yesterday, even though my cfg file is set to not allow updates. Since the upgrade, searching by name function has stopped working, that is to say: I used to be able to type "yahoo" in the address bar and go directly to yahoo; now, when I type everything that is not a full URL in the address bar, he goes to allied.com. I've been in: config and changed the keyword: URL to http://www.google.com/search?ie=UTF-8 & oe = UTF - 8 & sourceid = navclient & gfns = 1 & q = and have also installed the add-on search by name. None of these work. Please help me.

    Because of this definition of the keyword. URL pref stay?

    If you do not keep the changes after a reboot or have problems with preferences, see:

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the startup window Mode safe or make changes.

    Do a check with some malware malware, analysis of programs on the Windows computer.

    Please scan with all programs, because each program detects a different malicious program.

    Make sure that you update each program to get the latest version of their databases before scanning.

    Alternatively, you can write a check for an infection rootkit TDSSKiller.

    See also:

  • functions of YouTube works do not (such as adding to the playlist comment)

    Hello.
    functions of YouTube works do not (such as adding to the playlist comment) has stopped working, they are still working for the same account on chrome or another browser. (when it happened I didn't update or downgrade programs, addons, plugins that run in firefox or chrome, I don't see why all of a sudden).
    so I can't like videos, I get the message 'feature not available try later', can't add videos to the playlist (whole playlist including fav, as: Watch more later playlist pre made by youtube) and can't comment, for these 2 functions, I get the message 'invalid request '.
    all this happen again and many times, they stop or I can't make it work with reboot, refresh, try again.
    I did a fresh install of firefox and all it's the addons, plugins, same installation fees of adobe and divx, vlc products (which have the plugins or addons in firefox)
    After installing I could like comment add to playlist, before the snap all the addons, but I could only play HTML5 in youtube, any video that had no HTML5 support required at adobe. (after that I installed adobe it worked until I restarted the browser).
    now it does not work yet. (to disable, uninstall all the addons, plugins does not affect the problem)

    Some issues may also occur because of ProxTube - at least, I realized that I was was instantly redirected to the first film in the playlist on youtube - having no chance to see the entire playlist. It works when I disabled ProxTube.

  • I want to record with < alt > < s > in the Exact program online. This function does not work. This is the first time I use this program with firefox.

    Question
    I want to record with < alt > < s > in the Exact program online. This function does not work. This is the first time I use this program with firefox.

    edit, escaped mod < s > in order to avoid the line through question

    A web page can be defined a "accesskey" for an item. Unlike IE/Chrome/Safari, who use the Alt key only, Firefox requires pressing Alt and Shift to activate the element. In other words, try

    ALT + SHIFT + S

    and see if it works.

    I don't know of any way to change this so that the change is not necessary. There may be an add-on?

  • Satellite Pro 6000; sleep function does not work after upgrade W98 SE to XP

    I bought a windows XP cd and installed on W98 on my Satellite Pro 6000. The sleep function does not work now. I probably need a software of Toshiba. What do I need? Where can I find? What is the order of installation?

    Hello

    All drivers Windows XP Home edition, tools and utilities you can find on Toshiba support page under http://eu.computers.toshiba-europe.com > support & downloads. You have old laptop model and because of this type of product, you choose option ARCHIVE.

    Order of the facilities is as follows:
    -Windows XP
    -Display driver
    -Audio driver
    Toshiba - common modules
    -SD Card host driver
    -SD Card Driver
    -BlueTooth Stack
    BlueTooth - Easy Connect
    -Mouse driver
    -Modem driver
    -LAN driver included with Windows XP
    -Infrared driver
    -Toshiba Power Saver
    Utilities - Toshiba
    Toshiba - post Mobile
    -Toshiba Console worm.
    -Toshiba Hotkey for display devices

    I hope that you will be able to install Windows XP Home edition successfully.

    Good luck!

  • My touchpad scroll function does not work in Firefox 4

    4 years Dell Inspiron 1520 with a Synaptics touchpad, running XP. Just downloaded FF4 last night, now discovered that my scrolling on the touchpad function no longer works. It's very irritating. If no fix is available, how to go back to the previous version of FF?

    Try running Firefox in questions to troubleshoot Firefox in Safe Mode. If it works properly in this configuration, then one of your modules is the culprit.

    By the way, I recommend you visit the Plugins check page and update your plugins. You are potentially expose your system to attack with some versions you have installed at the moment. Their update can also solve the problem with your touchpad.

    In case the previous steps do not resolve the problem for you, you can return to the previous version and secure that 3.6.16 as follows.

    1. Go to Download Firefox v3.6.16 and download it to your desktop.
    2. Then go to add/remove programs, scroll down to Mozilla Firefox and remove it, choosing to keep your bookmarks, etc., the customizations (don't tick the box).
    3. Reboot and delete the folder called Mozilla Firefox at this location: C:\Program Files\Mozilla Firefox
    4. Finally, run the downloaded installation file.
  • A210-17i XP function keys not working not

    Hey, I bought a Notbook Equium model: A210-17i, I downgraded to XP, and I need the function keys to work.
    It doesn't seem to be all the drivers available to me, if someone can please help me find?

    Any help would be appreciated!

    Have you installed all the drivers from Toshiba?

    Be sure to only install the driver Hotkey, modules, FN-Esse, Toshiba common controls. An update of the BIOS can also help :)

  • curve adjustment function does not work

    Hi all

    I am trying to bend fitting, a graphic. but the curve adjustment function does not work. I get no output curve.

    which suggests to me u.

    Thank you

    You have been asked to view the code. We cannot solve the photos.

    Matrices X and Y are same length? Is a NaN value? What the output error say you?

    (Also note that in this case, it would be convenient if we don't need to wire x take a look at this idea!)

    This discussion is useless until you attach a real VI and data, so please.

  • asynchronuous functions do not work in a c# used by CVI application dll

    Hello

    I have an application written with CVI 9.0.1, who must interact with a dll c# 2010 (which has no window) through a CVI<->wrapper .net (created with the controller of the CVI useful .net).

    This c# dll uses the functions asynchronuous, as NetworkStream.BeginRead () and EndRead() of an object of System.Net.Sockets.TcpClient for example.

    These asynchronuous functions work very well when the c# dll is used by a c# application (with a main window) or the c# dll is converted into a stand-alone c# program (having a window with buttons, call its methods, just to try), but asynchronuous functions do not work when my c# dll is called by my CVI application (which is my goal) : execution remains inside the NetworkStream.BeginRead () for example (for the concerned thread).

    NetworkStream.BeginRead () can be bypassed successfully by using the function alternator NetworkStream.Read () instead, but the c# dll uses any other asynchronuous functions which have no associated alternator function.

    Here's some c# code (I don't have the source code of the Snmp object; got_trap() method is never called when asynchonuous calls do not work):

    public void run() / / wire

    {

    SNMP snmp = null;

    Try

    {

    SNMP = new Snmp (true);

    SNMP. NotifyListenPort = 162;

    SNMP. NotifyRegister (null, null, new NotifyCallback (got_trap), CB_DATA_);

    isActive = true;

    Timeout.Infinite;

    }

    ...

    }

    Thinking it might be a problem with the window messages that could not be processed (in the c# dll), I tried to replace the Timeout.Infinite statement in the code where the management of asynchronuous are held, by a creation of window over my loop of messages in Win32 window, but asynchronuous functions do not work better (while my loop seems to process messages successfully) :

    Form myForm = new Form(); an empty window

    myForm.Show ();

    int bRet;

    MSG msg = new MSG();

    While ((bRet = GetMessage (out msg, IntPtr.Zero, 0, 0))! = 0)

    {

    If (bRet == - 1).

    {

    handle the error and possibly out

    }

    on the other

    {

    Switch (msg.message)

    {

    default: / / everything else

    TranslateMessage (Ref msg);

    DispatchMessage (Ref msg);

    break;

    }

    }

    }

    Any idea?

    Thank you

    rvfr.

    Solved: in fact, the Assembly of snmp I used just need to be registered dotNet.

    rvfr.

  • My gesture control function does not work correctly there on and off automatically

    My gesture control function does not work correctly there on and off automatically

    which application you are using? try reinstalling the media gallery.

  • All the Windows media player play function has stopped working

    Original title: windows media player

    My system is Vista service pack 2. Recently, I've noticed that when my music on media player. Play all function has stopped working as before. It will not go forward or backward unless I type in the artist on my search bar. Is there a setting that went wrong and a simple solution, please. I don't know noty when it started to do that I have such a big library I use mostly the search bar. But I would like to play them all when I scroll to the bottom of my list of the library. Yours if fine!

    Hello

    ·         Are you trying to use play all the features in Windows media player or Windows Explorer?

    ·         The option is available on the details pane or the playlist?

    I suggest you follow the steps mentioned below:

    Method 1:

    Race he difficulty of the link and check if the problem persists:

    http://support.Microsoft.com/mats/windows_media_player_diagnostic/

    Method 2:

    If you use Windows play explore all the functionality, you can run the System File Checker tool to troubleshoot missing or corrupted system files and check if the problem persists:

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

    Method 3:

    If the previous step fails, follow the steps in the link:

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-in-Windows-Media-Player

  • AUTO PLAYBACK FUNCTION DOES NOT WORK

    AUTO PLAYBACK FUNCTION DOES NOT WORK WITH MY ADOBE PHOTOSHOP 7

    Try to uninstall and reinstall the program.  If this does not work, then I suggest that you contact adobe at http://www.adobe.com/support/photoshop/support.  This doesn't seem to be a Vista problem - it sounds like a problem with Adobe Photoshop. Lorien - a - MCSE/MCSA/network + / A +.

  • HP Envy 100: Scan function no longer works on my printer

    Recently moved locations and had to re set my PC. Since then the scan function no longer works. I get the error message 'Scanner reported an error', 'Impossible to log on to the device. I've uninstalled and reinstalled the drivers from HP, I checked the internet connections and all work. Actually had a lot of problems earlier with the printer and the scanner re wireless connections but hoped to have finally overcome these.

    Is not part of the problem, but a real complaint about what is the purpose of wireless devices when they never work as well as the peripheral ethernet connected, someone really need to get it sorted .

    Can someone help me please to get my back operational system. I surgent now as it is on paternity leave and need to get some issues administrative doen at home in the next few days.

    Thank you very much

    Hello HevnLgh.

    The problem is now fixed and the printer and the scanner work. Don't know exactly what corretced it if it took time for the steps previously mentioned to kick but I also tried to use the wi - fi protected installation set-up that exists on the printer and somewhere between all these steps, the connection between the pC and the printer has been restored.

    My very kind thank you for your efforts. I click the congratulations and accept it as a solution.

Maybe you are looking for