called when instantiating blackberry.ui.menu.MenuItem

I create a menu item:

var regPush = new blackberry.ui.menu.MenuItem(false, 1, "Push Registration", openBISPushListener());
blackberry.ui.menu.addMenuItem(regPush);

But openBISPushListener() is called during this menu item instantiation. When I comment the lines menu item, the code is not called.

Any ideas?

The problem is that you are setting and at the same time execution of the callback function to your menuItem.

Please see so endearing to the callback method works for you:

var regPush = new blackberry.ui.menu.MenuItem(false, 1, "Push Registration", openBISPushListener);

Note that I just removed the () on your openBISPushListener.

Tags: BlackBerry Developers

Similar Questions

  • which method is called when the screen has lost focus but stays on blackberry?

    Hello

    I want to know in which method is called when the screen has lost focus, but always visible BlackBerry?

    For example, a screen is in the foreground and we disply dialog box so that the screen is visible but not to focus, therefore, at this time that methos called when we close this dialog box?

    Please, help me please please

    Override the following methods in your class to screen according to your needs

    1. when the screen button to the stack

    Call

    onDisplay() or

    onUiEngineAttached(boolean attached) - so attached is true then your screen is at the top of the screen

    2. When you are in a backlight and the lcd screen turns off to your state of rest and turns on again when you actively use this form

    call

    onVisibilityChange(boolean visible) - if visible is set to true, then you get the focus when the lcd display turns

    3. when your application moves to the background by clicking the red end button (i.e. without quiting the app, yet yours is active in the background)

    call

    onExposed() - when your application comes to the foreground of the background or during any type of screen that is in the top get popped

    & call

    onObscured() - when your application moves to the background, or when a screen pushed above your current screen more

  • Error message when you use the menu buttons in IE but not chrome

    Hello.

    My recently transferred website has a problem when you use the menu anywhere on the site in Internet Explorer, but not on my mac using chrome? I get this error message came up on top of the screen which takes three clicks to go MuseJSAssert: error calling the function switch: TypeError: object does not support property or method . So, if I click on anything else it pop ups again. Any ideas how to get rid of this? I tried to re - download files from muse, but the same phenomenon occurs. I tried to download the files in a folder of exported frm different muse I saw had worked for someone else on here, but no difference? Any help much appreciated.

    Website: vanletteringco.com

    You might get an error that iPage are sorting when opening too, just remove the /root1 in the address bar to see the site?

    Thank you

    GAV

    Gavin,

    Using Jotforms should ideally create not the questions here. Did you try reseating Jotforms code? I suggest you to get a charge of Jotforms code and then try to insert it to test.

    Kind regards

    Sachin

  • Turn off the bar menu/MenuItem transitions/animations

    Is there a way to disable or change the speed at which MenuItems display when they are indicated by using a menu bar?

    It's one of those little annoying things that bug some people, even if it is only a fraction of a second delay. When you click a menu on a menu bar, most of the time you had rather just see the menu appear instantly rather than watch it expand all pretty similar before you can use it, heh.

    Well Yes, everything I need is this:


    {Menu}
    Open time: 0;
    }

  • View missed calls when the phone is off?

    Hello

    My phone turned off (or without service) incoming calls do not show on my list of missed calls.

    There may be a voicemail when my phone is back, but no match no missed calls.

    Is there a setting that will show you missed calls when the phone is off?

    Debra

    iPhone 6 s

    Once you turn back on your iPhone, all calls that occurred while the iPhone was off should appear in the Missed Call list.

    If they do not:

    • If you are in your area served by your cellular operator, contact your operator.
    • If you are outside this area (roaming), you can not see the calls until the return.  You could ask your cellular operator on this subject.
  • Unable to receive calls from Apple Watch, using WIFI AT & T calls, when the iPhone is turned on, turned off or in Airplane Mode.

    I work on this issue and wanted to involve the community.

    I have tests the functionality Apple Watch and have been unable to solve my problems with WIFI call. I use the AT & T and I am connect to the strip of the 5 GHz on my router Xfinity.

    I am able to make/receive calls from my iPad and Mac laptop when iPhone is off / Mode plane; However, this feature does not work on the watch. I can make and receive calls from the watch when the phone is turned on.

    Another problem is that I am not able to send and receive messages (blue or green bubble) of the watch - once again when the phone is turned off or in flight Mode

    I'll copy in 2 portions of the Web site: http://help.apple.com/watch/

    http://help.Apple.com/watch/#/apd0443fb403

    If your Apple Watch is in range of a Wi - Fi network that the iPhone is connected to before, you can always do the following (even if the iPhone is off):

    • Send and receive digital messages Touch
    • Send and receive messages using Messages
    • Make and receive phone calls (if you have active calls, Wi - Fi, and you are within range of a Wi - Fi connected to your iPhone before)
    • Check current weather conditions
    • Track your inventory

    http://help.Apple.com/watch/#/apd2fe746e86

    Make calls via Wi - Fi

    If your cellular operator offers Wi - Fi calls, you can use Apple Watch to make and receive calls over Wi - Fi instead of cellular network - even when your pair iPhone isn't with you or is disabled. Apple Watch comes to be in range of a Wi - Fi network that is connected to your iPhone in the past.

    To see if your carrier offers Wi - Fi calls, see the article Apple Support phone with Wi-Fi calls, then enable the calls on your iPhone and Apple Watch Wi - Fi.

    Note: You can make emergency calls via Wi - Fi, but when possible, use rather iPhone over a cellular connection - your location information will be more specific.

    Enable on iPhone Wi - Fi calls. On iPhone, go to settings > phone and turn on Wi - Fi calling and application to other devices.

    Enable calls on Apple Watch Wi - Fi. Open the Apple Watch app on iPhone, tap My Watch, tap phone, then turn on Wi - Fi calls. If you do not see the parameter, make sure that you have activated calls on iPhone Wi - Fi.

    Answer please if you are able to perform any of these functions! And any troubleshooting you can think!

    AspiringAppleGuru wrote:

    I have... to connect to the 5 GHz on my... router bandwidth.

    Hello

    These features are not available because Apple Watch cannot connect to a network of GHz Wi - Fi 5.

    If your watch is not connected to your iPhone via Bluetooth, but lying in a 2.4 GHz Wi - Fi network your iPhone plugged in before, the watch can connect to this network and you can continue to use certain features, including Wi - Fi calls (when it is supported by your operator, you already have in place).

    More information:

    On Bluetooth and Wi - Fi on Apple Watch - Apple Support

    Use Apple Watch without her sister iPhone - Apple Support

  • Siri doesn't let me make a call when the phone is locked

    Siri doesn't let me make a phone call when my phone is locked. This is not the case with other phones in my family, but I can't find a setting to change. Any ideas?

    iPhone 6 with the latest iOS.

    Found the answer. It's under "Contact ID and password". Select "voice dialing".

  • cannot answer the calls when 'asleep '. Swipe will not work, but appeal continues to ring

    cannot answer the calls when 'asleep '. Swipe will not work, but appeal continues to ring

    If you have not already, try to force reboot the phone by holding down the button sleep and home for 10 seconds, until the Apple logo comes back again. You won't lose any data, but it can cure a few glitches.

    If it does not, and to make sure that this isn't related software, set it back to factory settings, without using any data backup later. Set up the rest of the personal settings manually and test the phone.

    If it still does not respond, it could be a hardware problem and the phone must be repaired by Apple or an Apple authorized Service Provider:

    Use iTunes to restore your device to factory settings - Support Apple iOS

    Find an Apple authorized service provider

    Apple iPhone - contact Support - support

  • I'm not receiving calls when internet we


    Calls go to voicemail? There is an option under dual SIM settings > behavior Data > connection priority, which determines what happens for voice calls when data are on.

    It may also depend on what SIM card you are using for data / what SIM calls come to. He'll be right a SIM card, or both?

  • will not display list of program when I hit start menu

    When I hit the computer button all programs will not display any installed programs, weird!

    http://WindowsXP.MVPs.org/allprograms.htm
    When you click the menu programs on the Start Menu, it can show (empty)
    Nothing happens when you click on all programs on the Start Menu
    Not all the shortcuts are displayed

  • Repeat a call when the line is busy?

    Is it possible to have the phone to repeat a call when the called line is busy? I can't find this simple function.

    You'll need an app for that, look for type of automatic redial of applications such as

    https://play.Google.com/store/apps/details?ID=com.adengappa&hl=en

  • BlackBerry.UI.menu is not defined

    Hello

    I'm developing an application using the SDK Webworks for BB10 (no playbook).

    I am creating an application menu using the blackberry.ui.menu but webinspector reports it as undefined.

    I'm working on Windows with WebWorks SDK version 1.0.4.11 platform

    I tried console.log (blackberry.ui) and I got:

    Object {toast: object}

    (As I understood my config file blackberry.ui.toast. XML) toast and dialogue are works fine for me, but no menu.

    I found that I have no 'menu' file Webworks SDK path\Framework\ext\

    I have only ui.toast, ui.cover, ui.dialog and ui.contextmenu files. Is this a problem?

    Either by the way, I configured the file config.xml for debugging and here is my file config.xml

        
        
        
        
        
        
        https://getpocket.com" subdomains="true" />
    

    I do posts from ajax to the getpocket domain specified, but all the work is done by local files. I also tried to add access uri * and disabling websecurity, but it doesn't seem to work.

    I'd be happy if someone could guide me where I could go wrong.

    This repository is for WebWorks BBOS and PlayBook. Samples for BB10 are in the BB10-WebWorks-community-samples repository here: https://github.com/blackberry/BB10-WebWorks-Community-Samples

  • Call a "invokeAction' of the Menu item button

    Hello

    If I have a button and you wrote the code for the invokeAction method is, it is possible to call this button to a menu item invokeAction method?

    I guess I could just copy the code from this button and add it to the menu. I'm really wondering if there is an easier way.

    (Sorry if this has already been achieved in this forum, I'm not sure what kind of search terms I would use to find a solution to my question.)

    Thank you!

    invokeAction is protected, so you can not call it directly. You can play games such as deriving from a subclass with invokeAction made public. But it is usually easier to have just the listening port of the button and the listener of the element menu to call a common method. It's simple and obvious if the listeners are in the same module of code and a little more complicated if they are not, of course.  In general the code duplication is a bad idea, but it's even worse if duplicates are in different modules.

  • How can I manage incoming calls when my application is running?

    HII all,.

    Is there an API to manage incoming calls or sms while my application is running? I want to put my app in the background & allow user to reach call when an incoming call is reported.

    Kind regards

    Nishant Shah

    BB10 there as the still no API for this, although "flight arrival advice" can give you an idea what is on the horizon.

    I do not think that the logical use case but... the operating system will be incoming calls and notify the user in a way, and it is not your application to get out of the way like that.  Perhaps the user wants to ignore the call. In all cases, it will be a trivial gesture (corner kick?) by the user to answer the call.

    I don't think you should try to deal with quite different that any other application will be, that is to say completely ignore and do nothing.

  • The phones call log smart blackBerry does not display date/time/period of appeal...

    YET to learn... I know...

    I like to call log to be separated from my "messages"...

    But I want the call log to provide information such as the time and duration of call...

    In any case, the way to do it WITHOUT adding in the 'messages' list so that it gets all mixed in the e-mail and calls, etc.  I like having separate calls/messages/texts. Maybe I could just "Finish" with the "messages" application and have everything in a separate application. ?  For now, I have TEXT Messages in a single application (which I love) but my email goes to the email app and the application "messages".  Can I have a detailed call log and carry 'messages'?

    Thank you

    If you can change the display of the call log. On what you are in the call log, press the key menu you and go in the Options. Then, go to the General Options. You can change the phone list view in the call log. Which shows the date of a call.

    If you highlight a name, press your menu button, you can enter the story as seen looking more details about all the times that name/number was called.

Maybe you are looking for