Help: fieldChanged is not implemented

Hello

Please help me on this bug.

I'm working on BB Storm2 9520, developing on JRE 5.0.0 not JRE (API) 6.0.0

I created a class BaseScreen, which extends the screen and implements FieldChangeListener

public abstract class BaseScreen extends MainScreen implements FieldChangeListener{    protected MToolbarButtonField btn1;    protected MToolbarButtonField btn2;    protected MToolbarButtonField btn3;    protected MToolbarButtonField btn4;    protected MToolbarButtonField btn5;    protected ToolbarManager toolbarManager;

    public BaseScreen() {        toolbarManager = new ToolbarManager();        HorizontalFieldManager hfm = new HorizontalFieldManager();        hfm.add(btn1);        hfm.add(btn2);        hfm.add(btn3);        hfm.add(btn4);        hfm.add(btn5);        toolbarManager.add(hfm);        setStatus(toolbarManager);    }

    public void fieldChanged(Field field, int context)     {        System.out.println("======== Toolbar Button Clicled ========");    }

}

Class MToolbarButtonField extends the ToolbarButtonField class:

public class MToolbarButtonField extends ToolbarButtonField{    private Bitmap bmpIcon;

    public MToolbarButtonField(Bitmap bmp) {        super(Field.FOCUSABLE, bmp);        bmpIcon = bmp;    }

    protected void paint(Graphics g) {        //...    }}

Class ToolbarButtonField extends the class of field:

public class ToolbarButtonField extends Field{    private Bitmap bmpIcon;

    public ToolbarButtonField(long style, Bitmap bmp) {        super(style);        bmpIcon = bmp;    }

    protected void paint(Graphics g) {        //...    }

    protected boolean navigationClick(int status, int time)     {        fieldChangeNotify(1);        return true;    }

}

Then, I created some screens that extends the BaseScreen class and FieldChangeListener tools:

public class Screen1 extends BaseScreen implements FieldChangeListener{    private BitmapButtonField btn1;    private BitmapButtonField btn2;

    public Screen1() {        btn1 = new          BitmapButtonField(Bitmap.getBitmapResource(               "bntmyinfos.png"),              Field.FOCUSABLE| FIELD_LEFT | FIELD_VCENTER);        btn2 = new BitmapButtonField(Bitmap.getBitmapResource(              "bntmycont.png"),              Field.FOCUSABLE| FIELD_LEFT | FIELD_VCENTER);    }

    public void fieldChanged(Field field, int context) {        System.out.println("==== Screen1 buttons clicked");        //...    }}

When I clicked on the btn1, btn2 on Screen1, the Screen1.fieldChanged prints to the Console Windows "= Screen1 buttons clicked.

But when I clicked the btn1 on toolbar, nothing happenned.

I've already put the style buttons toolbarManager are FOCUSABLE so why nothing is there?

What should I do to make the BaseScreen.fieldChanged took place?

Everyone please help.

Thanks in advance.

Hi guys,.

Thank you for your support.

Now, I already solved the problem.

And the solution is the fieldChangeNotify (int context) method.

Add this method in the ToolbarButtonField class, and it works.

Here is my code that worked:

ToolbarButtonField

public class ToolbarButtonField extends Field (    private Bitmap bmpIcon;

    public ToolbarButtonField(Bitmap bmp)    {        super(Field.FOCUSABLE);        bmpIcon = bmp;    }

    protected void fieldChangeNotify(int context) {           this.getChangeListener().fieldChanged(this, context);       }

    protected boolean navigationClick(int status, int time)     {        fieldChangeNotify(1);        return true;    }

    protected void paint(Graphics g)    {        //...    }    //...}

and some changes: in BaseScreen, let the fieldChanged method do nothing, change the MToolbarButtonField of extends from ToolbarButtonField to implements FieldChangeListener, and then implement the fieldChanged here method:

public class MToolbarButtonField implements FieldChangeListener {
    private Bitmap bmpIcon;
    private BaseScreen caller
    private ToolbarButtonField btn1;
    private ToolbarButtonField btn2;
    private ToolbarButtonField btn3;
    private ToolbarButtonField btn4;
    private ToolbarButtonField btn5;
    private VerticalFieldManager toolbarFieldManager;

    public MToolbarButtonField(BaseScreen caller) {
        this.caller = caller;
        toolbarFieldManager = new VerticalFieldManager();

        btn1 = new ToolbarButtonField();
        btn1.setChangeListener(this);
        btn2 = new ToolbarButtonField();
        btn2.setChangeListener(this);
        btn3 = new ToolbarButtonField();
        btn3.setChangeListener(this);
        btn4 = new ToolbarButtonField();
        btn4.setChangeListener(this);
        btn5 = new ToolbarButtonField();
        btn5.setChangeListener(this);

        toolbarFieldManager.add(btn1);
        toolbarFieldManager.add(btn2);
        toolbarFieldManager.add(btn3);
        toolbarFieldManager.add(btn4);
        toolbarFieldManager.add(btn5);
    }

    public void addToolbarToScreen()
    {
        caller.setStatus(toolbarFieldManager);
    }

    public void fieldChanged(Field field, int context)
    {
        if (field == btn1)
        {
            System.out.println("Button 1 clicked !");
        }
        if (field == btn2)
        {
            System.out.println("Button 2 clicked !");
        }
        if (field == btn3)
        {
            System.out.println("Button 3 clicked !");
        }
        if (field == btn4)
        {
            System.out.println("Button 4 clicked !");
        }
        if (field == btn5)
        {
            System.out.println("Button 5 clicked !");
        }
    }
}

BaseScreen:

public abstract class BaseScreen extends MainScreen implements FieldChangeListener
{
    MToolbar toolbarManager;
    /**
     * Creates a new MyScreen object
     */
    public BaseScreen()
    {
        // Set the displayed title of the screen
        setTitle("Toolbar Button display");

        toolbarManager = new MToolbar(this);
        toolbarManager.addToolbarToScreen();
    }
}

MyScreen (Screen1 last time):

public class MyScreen extends BaseScreen {
    private ButtonField btn6;
    private ButtonField btn7;

    VerticalFieldManager vfm;

    public MyScreen()
    {
    vfm = new VerticalFieldManager();
    btn6 = new ButtonField("MyScr button 1", Field.FOCUSABLE);
    btn6.setChangeListener(new FieldChangeListener()
    {
        public void fieldChanged(Field field, int content)
        {
        Dialog.alert("My Screen's button 1 clicked!");
        }
    });
    vfm.add(btn6);

    btn7 = new ButtonField("MyScr button 2", Field.FOCUSABLE);
    btn7.setChangeListener(new FieldChangeListener()
    {
        public void fieldChanged(Field field, int content)
        {
        Dialog.alert("My Screen's button 2 clicked!");
        }
    });
    vfm.add(btn7);

    this.add(vfm);
    }
}

Tags: BlackBerry Developers

Similar Questions

  • I get a JavaScript Application error: "setTimeout" called on an object that does not implement the interface Window for Firefox.

    I get a pop up box with the message: Application JavaScript error: "setTimeout" called on an object that does not implement the interface Window for Firefox.

    But it seems to appear when I go to Amazon.com. Then he opens with this message and the OK option? But as fast as I can click OK, another box appears. After all a half dozen, she disappears - until what I move to another part of Amazon! I uninstalled - reinstalled and then - Firefox and BA. I do not understand this!

    (And of course, there is always the possibility that it is not only attacking me on Amazon... There may be a lot of other sites that also trigger, and I just haven't been there yet.)

    Hello

    Try Firefox Safe mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that temporarily disables hardware acceleration, restores some settings and disables add-ons (extensions and themes).

    If Firefox is open, you can restart Firefox Safe mode in the Help menu:

    • In Firefox 29,0 and above, click on the menu button

      click Help

      then select restart with disabled modules.

    • In previous versions of Firefox, click on the Firefox button in the upper left of the Firefox window and click help (or click on help in the Menu bar, if you do not have a Firefox button) and click on restart with disabled modules.

    If Firefox is not running, you can start Firefox in Mode safe mode as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    When the Firefox Safe Mode window appears, select "start mode safe."

    If the problem is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme or hardware acceleration. Please follow the steps described in the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. This might help others with the same problem.

  • I get an error, "the executable file that this service is configured to run does not implement the service" when I try to synchronize the time in Windows XP.

    After trying to fix the error of time synchronization by typing net start w32time that receipt of the message in the title.  In addition, type net stop w32time responded that the service was not working.

    Original title: the executable that this service is configured to run does not implement the service

    After checking the configuration in the registry and check or update if necessary from the link below:

    Then the time errors that I got from the command prompt window:
    Order--> net stop w32time & net start w32time
    Response--> The Windows Time service is not started.

    Order--> net start w32time
    Response--> system error 1083.
    The executable program that this service is configured to run in does not implement the service.

    --> Command w32tm/Resync /rediscover
    Response--> sending command to local computer resync...
    The following error occurred: the RPC server is unavailbale. (0x800706BA)

    Hi Mitchell_G,

    Thank you for keeping us posted.

    The steps of items offered in the previous post?

    We know if you need help. We will be happy to help you.

    Thank you.

  • 'Not implemented protocol 0' on the show SmartCardSession.sendAPDU command

    I'm developing a new application for smart card.

    I created my driver and session classes and load them.

    Here is the code in the class sessions that tries to send a command UDPA la carte:

           CommandAPDU command = new CommandAPDU( (byte)0x00, (byte)0x182, (byte)0x00, (byte)0x25, (byte)0x07 );
            ResponseAPDU response = new ResponseAPDU();
            try {
                sendAPDU( command, response );
    

    I have a SmartCardException with a message of "Protocol not implemented 0" when I try to run the sendAPDU command.

    Help, please.

    To the page:

    Phone: BlackBerry 8330.

    Software: 4.5.0.77

    The smart card reader is the reader of smart card BlackBerry, model: RBB10BW.

    Both the player and the BlackBerry are the latest smart card reader drivers available on the website (4.2.0.107).

    I talked to Mike Kirkup on the EDGE, and it turns out that this is a bug in the way that the drivers are the analysis of the ATR.  The smart card supports T0, but because of the wrong analysis of the RTA, the driver is unable to detect T0 support.  Mike has developers who are working on a fix.  Apparently, it will take the drivers of news reader.  If you know Mike, please urge along.

    Thank you.

  • exception GetActivities API - GetActivities() is not implemented for "ProcessedActivity" - how to manage

    I'm going to pull data via API eloqua activities calling GetActivities but looks like it's broken for me, I took the reference in section http://topliners.eloqua.com/community/code_it/blog/2011/12/09/eloqua-api-how-to-retrieve-activity-data-through-the-api which says they have done to obtain activity data. I'm passing similar settings in the SOAPUI but I get the error like GetActivities() is not implemented for 'ProcessedActivity'. Could someone help me understand what I'm doing wrong attached here is the screenshot of the response of demand SOAPUI vsSOAPUI_Error.JPG

    Hello

    It seems that your integration area is configured to map your internal events only to your Salesforce CRM installation. The treated activity queue is enabled, but it is not all calls mapped. You need to just contact support and ask them to add external calls (QIP) for any event you wish to track: send Email, form submit, etc...

    Please note that your existing Salesforce.com integration will remain unchanged, they will add only new calls to the card and write data in the QIP.

    Hope this helps,

    Fred

  • What to do when the required help screens will not accept any existing ID or passwords? 13 download to PC elements missing section archive. Normal help screen will not accept any adobe exisitg D. Whatdo, I do now?

    What to do when the required help screens will not accept exixting ID or password?

    Downloaded items 13 PC. Implementation noted this archive missing article.

    If something is demanding a password is not likely to be a request for Adobe since Adobe does not normally require any.  It could be your computer's security requiring you to allow an installation to occur.

  • Economy through plugins compatible player - a function not implemented or obsolete was called

    Hello

    I have recently compatible drive my plugin and make me a problem using PDDocSave; get "a not implemented or obsolete function was called.

    Test X and XI has the same answer.

    Reading Re: Acrobat Reader X and PDDocSave it seems that it is a bug in X, but I would have taken something like this would be fixed by XI.

    The code below has save the file where it is, but I'm also calling the function with the PDSaveCopy flag to another location and get the same result.

    AVDoc avDoc = AVAppGetActiveDoc();

    PDDoc pdDoc = AVDocGetPDDoc (avDoc);

    ASFile asFile = PDDocGetFile (pdDoc);

    ASFileSys asFileSys = ASFileGetFileSys (asFile);

    Céline ASPathName = ASFileAcquirePathName (asFile);

    PDDocSave (pdDoc, PDSaveFull |) PDSaveLinearized | PDSaveCollectGarbage, celine, asFileSys, NULL, NULL);

    I thought that maybe the Save flags may have been the cause, but eliminate one by one had no change.

    I do not have the /READER_PLUGIN condition that, if I do I can not compile at all - Re: how to save the active document in my reader plugin?

    Thanks for your help. Thought that I ask here before putting in a request for assistance.

    I set it with AvDocDoSave and PDDocCopyToFile, both of these work in the drive.

    EDIT: I've marked this as the correct answer because it contains what I did to fix my problem, but I want to give credit to lrosenth for putting me on the right track.

  • Somewhere, I messed up my permissions, turn off the computer to see if it helped, now will not start at all. The start bar stops a quarter turn along. I tried in SafeMode as well do. I ' on a Yosemite iMac running.

    Somewhere, I messed up my permissions, turn off the computer to see if it helped, now will not start at all. The start bar stops a quarter turn along. I tried in SafeMode as well do. I ' on a Yosemite iMac running. I can't enter to give more details. Can anyone help? There are a load of work due to deliver to the printing press Monday

    Have you tried to boot from the Partition Recovery and repair then the disc from there, using disk utility?

  • I get download error messages, could not be opened beak helper app does not exist, chg association suggestions - what to do?

    I get - download error - / Users/ffrasher / / Desktop/Firefps
    3.6.13.dmg could not be opened, because the associated helper app does not exist. Changing the association in your preferences. I run MOSX 1.3.9 Firefox 2.0.0.20. What I can do to upgrade.

    Frank

    See:

  • I can NOT connect my Facebook account to make Yahtzee can access my contacts. He said that Facebook is not configured on this phone. ??? I have also a certificate has expired and do NOT know how to get a certificate of update. ?  Please Help, I have NOT b

    I can NOT connect my Facebook account to make Yahtzee can access my contacts. He said that Facebook is not configured on this phone. ??? What this mean and how can I solve this problem? I have also a certificate has expired and do NOT know how to get a certificate of update. ?  Please Help, I have NOT been able to get help from any of these Issuea. Very frustrated. Please contact me by txt on my iPhone 352-257-9403 if possible. Thank you for your support

    iOS 9.2.1

    certificate is daily horoscope

    wwhat the devil is and why it has expired?

  • I just ran the last update for my iPad and now it just continuously reboots to the black screen with the Apple Logo. Hard restarting does not help, neither do not connect the camera to MacBookPro. Any ideas?

    I just ran the last update for my iPad and now it just continuously reboots to the black screen with the Apple Logo. I left plugged in all night and still no change. Hard restarting does not help, neither do not connect the unit to aMacBookPro. When I do this, iTunes complains that it can not connect because the iPad 'expires '. Now it is disconnected, but I can't turn it off. Even close the lid will not extinguish it. Any ideas?

    Try the following. It seems yo may have to let the battery drain is completely:

    - iOS: do not respond or does not light

    -Also try DFU mode recovery mode post-test

    How to put iPod touch / iPhone in DFU "Karthik doodles."

    -If failed and that you cannot completely turn completely the iOS device, leave the battery to drain completely. After loading a hour repeat the foregoing.

    -Try a different cable

    -Try on another computer

    S ' there is still not successful that usually indicates a hardware problem and an appointment at an Apple store Genius Bar is in order.

    Shop Apple Store - Genius Bar

  • HELP & SUPPORT DOES NOT OPEN

    Help & Support does not open. I have the msg "...". a service system does not work. To resolve this problem, start the service named 'help and Support '.

    I can NOT open help and support in order to start the service.
    Can you please help?
    Thank you
    John

    Hello

    ·         Were there recent changes made on the computer before the show?

    To resolve this issue, start the Help and Support Center service and set it to automatic. Follow these steps:

    (a) click Start, run and type Services.msc

    (b) double click on help and Support

    (c) to set the startup type to Automatic

    (d) start the Service

    See also:

    Menu help and bootable media will not open

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

    Registry warning

    To do: Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    322756 (http://support.microsoft.com/kb/322756/)

    How to back up and restore the registry in Windows

  • my work of collapsed app coil system, help printer does not work

    my work of collapsed app coil system, help printer does not work

    Hello

    1. What is the brand and model of the printer?

    2. do you have an error message when you try to print?

    3. were there any changes (hardware or software) to the computer before the show?

    Perform the steps suggested by chan seen from the link below and see if it helps.

    http://social.technet.Microsoft.com/forums/en/itprovistaprinting/thread/460f297a-dd66-4476-A176-542e1519ca3e

    Hope this information helps.

  • everything is so big (words, etc.) that some things are cut. Help. Im not a computer buff so this can be simple for someone else.

    everything is so big (words, etc.) that some things are cut. Help. Im not a computer buff so this can be simple for someone else. For example... this screen as I'm typing this on Cup right now to the right of this box, I type in where it says "search forums" after the R in the forum.

    Hi 1958debbie,

    you don't need to do a system restore.

    Below, to the right of your screen, there is a % of films xxx next to a down arrow. Click this arrow and select 100%.

  • McAfee suddenly presents itself as "software not implemented."

    I have a laptop Dell Inspiron running Windows 8. The McAfee anti-virus program has been preinstalled on it and worked perfectly, but now all of a sudden she appears as "software not implemented" in the hidden icons bar. It seems to works perfectly fine, however. Should I be worried? Lately, my computer freezes quite frequently and only a hard reboot can save. The computer is infected or about to crash?

    Simply double-click the Mcafee icon in the taskbar. Your McAfee account information will open. You will be asked to enter your login email here so that mcafee you can send your magnetic membership card. And in fact, now the Mcafee product is configured. It will no longer show this warning.

Maybe you are looking for