Problem with the context menu: eception typeError: cannot read property CONTEXT_IMAGE undefined

Hi, I wanted to try the following context menu with the javaScript function:

function addMyItem() {
        var myItem = { actionId: 'Delete', label: 'Delete', icon: 'delete.png' },
            contexts = [blackberry.ui.contextmenu.CONTEXT_IMAGE, blackberry.ui.contextmenu.CONTEXT_INPUT];
        blackberry.ui.contextmenu.addItem(contexts, myItem, function () { console.log('hi') });
    }

I have this function of reference on the API [1]

When I try to run this function, I get the error:

Eception typeError: cannot read property CONTEXT_IMAGE undefined

 


What's not here?

EDIT: I have the function ID in my config


[1] https://developer.blackberry.com/html5/apis/blackberry.ui.contextmenu.html

I have a little differently, but have checked that it worked for me during a test.

var share = {
  actionId: 'share',
  label: 'Share Image',
  icon: '../images/share.png'
};

var contexts = [blackberry.ui.contextmenu.CONTEXT_IMAGE];

blackberry.ui.contextmenu.addItem(contexts, share, function(){
  alert('Sharing is caring!');
});

If this does not work, can you let us know what development kit software that you use, and we can test again if necessary?

Tags: BlackBerry Developers

Similar Questions

  • JQuery: Eception TypeError: cannot read property 'setDefaults"undefined

    Hello

    My page was working fine, until I started to add more and more jquery library.

    Here is the error I get in the developer console:

    appointment_new_validation.js:3 Eception TypeError: cannot read property 'setDefaults"undefined

    The jquery validation plugin is not working now

    I tried to put the library links (in red) in all positions in the header and still get the error message.

    Here is the content of the page:

    <! doctype html >

    < html >

    < head >

    < meta charset = "utf-8" >

    < title > new appointment < /title >

    "< link rel ="icon"href ="... /... ' / images/favicon.ico "type =" image/x-icon"/ >

    " < script src =" https://code.jQuery.com/jQuery-2.1.1.min.js "type =" text/javascript"> < / script > "

    < script >

    function getDealership (val) {}

    $.ajax({)

    type: 'POST',

    URL: "appointment_new_check.php",

    data: 'dealershipgroup_id =' + val;

    success: {function (data)}

    $("#dealership_id").html (data);

    }

    });

    }

    {.changes (function ($(«#dealership_id»))

    Alert ('DOING GARAGE BOX VISIBLE');

    });

    < /script >

    " < script src =" http://AJAX.aspnetcdn.com/AJAX/jQuery/jQuery-2.1.3.min.js "> < / script > .

    " < script src =" http://AJAX.aspnetcdn.com/AJAX/jQuery.validate/1.13.0/jQuery.validate.min.js "> < / script > .

    " < script src =" http://AJAX.aspnetcdn.com/AJAX/jQuery.validate/1.13.0/additional-methods.min.js "> < / script > .

    < script src = "appointment_new_validation.js" > < / script >

    <! - delete notes jQuery - >

    < script type = "text/javascript" >

    $(document) .ready (function () {}

    $(".delete").click (function () {}

    $("#note_modal").show ();

    var note_id = $(this) .attr ('dir');

    $('.note_id').val (note_id);

    Alert (note_id);

    });

    $("#note_modal_button_no").click (function () {}

    $("#note_modal").hide ();

    });

    });

    {$(document) .ready (function ()}

    $(' #note_modal_button_yes') .css ('cursor', 'point') ravishing (function () {}

    var note_id = $('.note_id').val ();

    $.ajax({)

    type: 'POST',

    URL: "note_delete.php",

    data: {}

    note_id: note_id

    }

    {.done (function ())}

    Alert ('record has been deleted");

    Location.Reload ();

    });

    });

    });

    < /script >

    <!--> date picker

    "< link href="/scripts/jquery-ui-1.11.4.custom/jquery-ui.css "rel ="stylesheet"type =" text/css">

    "< script src="/scripts/jquery-ui-1.11.4.custom/external/jquery/jquery.js "> < / script >

    "< script src="/scripts/jquery-ui-1.11.4.custom/jquery-ui.js "> < / script >

    < script >

    {$(function()}

    $(«.datepicker»).datepicker({)

    numberOfMonths: 2.

    showButtonPanel: true,

    dateFormat: "dd-mm-yy".

    });

    });

    < /script >

    <! - time Picker - >

    "< link rel ="stylesheet"href="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css ">

    < script type = "text/javascript" >

    $(document) .ready (function () {}

    $('.timepicker').timepicker ({}

    timeFormat: "HH: mm"

    interval: 15,.

    minTime: '10'.

    maxTime: '22',

    defaultTime: '7'.

    startTime: 7:00 ',

    Dynamics: false,

    drop-down list: true,

    ScrollBar: true,

    });

    });

    < /script >

    < / head >

    < body >

    < name of the form = "new_appointment" id = "new_appointment" method = "POST" action = "appointment_new_create.php" >

    < div class = "column_2" >

    < div class = "column_section" >

    < div class = "column_section_header" > basic Details </span > < / div >

    <! - Person ID - >

    < div class = "form_field_tag" > customer < / div >

    < div class = "form_field_wrapper" >

    < input name = "personid" type = "text" class = "form_field" readonly value = "[ID: <?]" PHP echo $person_row ["renid"];? >] <? PHP echo $person_row ["title"].' '. $person_row ["FirstName"].' '. $person_row ['name'];? > ">"

    < / div >

    <! - DATE - >

    < div class = "form_field_tag" > appointment Date < / div >

    < div class = "form_field_wrapper" >

    < input type = "text" class = "datepicker form_field" name = 'date' >

    < / div >

    <! - TIME - >

    < div class = "form_field_tag" > appointment time < / div >

    < div class = "form_field_wrapper" >

    < input type = "text" class = 'timepicker form_field' name 'time' = >

    < / div >

    < / div >

    < / div >

    < div class = "column_2" >

    < div class = "column_section" >

    < div class = "column_section_header" > appointment location < / div >

    <!--dealer group-->

    < div class = "form_field_tag" > dealer group < / div >

    < div class = "form_field_wrapper" >

    < select class = "form_field" name = "dealershipgroup" id = "dealershipgroup-list" onChange = "getDealership (this.value); ">

    < option value = "-1" > select dealer group < / option >

    < option value = "-1" > - < / option >

    <? PHP {? >}

    < option value = "<?" PHP echo $dealership_group_row ['id'];? > "> <?" PHP echo $dealership_group_row ['name'];? > < / option >

    <? PHP} while ($dealership_group_row = $dealership_group_query-> fetch_assoc());? >

    < / select >

    < / div >

    <! - dealer - >

    < div class = "form_field_tag" > dealer < / div >

    < div class = "form_field_wrapper" >

    < select class = "form_field" name = 'dealer' id = 'dealership_id' >

    < option value = "-1" > select dealer < / option >

    < / select >

    < / div >

    < / div >

    < / div >

    < div class = "column_1" >

    < div class = "column_section" >

    < div style = "" text-align: center; ">"

    < input type = "submit" name = "submit" class = "form_submit_button" value = "Create appointment" >

    < / div >

    < / div >

    < / div >

    < / make >

    < / div >

    "< script src="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js "> < / script >

    < / body >

    < / html >

    Any help would be much appreciated!

    You should have 1 single jQuery core library by document.  At the top of your page you referenced jQ 2.1.1 and further down you have a reference 2nd in 2.1.3.  Delete a.

    Best practices: put all your scripts and functions at the bottom of the page.  Your page will load a little faster.

    Nancy O.

  • Error: "Eception TypeError: cannot read property 'getNumFrames" undefined "-when I test Flash/HTML5 in the browser

    I work in Flash / HTML5. When I publish directly from Flash, my project works very well. However if I open the HTML file directly in a browser, (I tested in Chrome and Safari on a Mac) I get this error message: easeljs - 0.8.1.min.js:13 Eception TypeError: cannot read property 'getNumFrames"of undefined a.load @ preloadjs - 0.6.1.min.js:12

    A google search suggested that the code tries to run before the document was loaded - so "undefined". However, I can see that the body of the HTML file tag seems to deal with this (I think) < body onload = "init (); »  ... The init() being the function that includes the Chargers how to control the loading of the file is made etc...

    Also, I get the error:

    XMLHttpRequest cannot load file:///Users/MyLocalPathToMyProject.../images/MyProject_atlas_.json. Original cross applications are only supported for Protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resources.

    Who could be responsible for the "undefined".

    Everyone knows about this problem? Can we simply cannot test it locally? Does anyone have a solution?

    Sprite sheets do not work from the local file system. Go to the publication settings and uncheck the sprite sheets.

  • Deleting parent symbol after the removal of child symbol throws "Eception TypeError: cannot read property 'id', null"in 20141.

    If a symbol of the child is removed first, and then the parent, he throws the error «Eception TypeError: cannot read property 'id', null'.»» Its also strange that the registration of all symbols of the child on the stage he lists as the grandchildren. These codes worked perfectly with previous versions, but not with 20141.

    The code used to print all the symbols of the scene:

    var chldns = sym.getComposition () .getStage () .getChildSymbols ();

    for (i = 0; i < chldns.length; i ++) {}

    Console.log ("-->" + chldns [i] .name);

    }

    Can someone tell me if this is a bug or there at - it another way to do this?

    Thank you.

    There is a bug in 20141. We have fixed this problem and the fix will be available soon in the next update. I think the problem that is described in this post ( removal of nested symbols problem ) is similar.

  • Eception TypeError: Cannot read property 'edge_authoring_mode' null

    I get the following error message and I don't know how to correct:

    Eception TypeError: Cannot read property 'edge_authoring_mode' null

    I searched for 'edge_authoring_mode ', but have not been able to find anything.  Can someone point me in the right direction and I would like to know why this would be null?

    Hi, I just wanted to mention that this error has been be bound to use the Composition of municipalities of edge charger.  Apparently, my variable "thestage" (which was used in the scene that you noted above) was occasionally (based on load time) still reference the old stadium which had been replaced by using the charger of the Composition.  Thank you for taking the time to try to help him with this.

  • MuseJSAssert: Error calling the function switch: TypeError: cannot read property 'msie' undefined. Please help me in this.

    MuseJSAssert: Error calling the function switch: TypeError: cannot read property 'msie' undefined. Please help me in this.

    Hello

    Please check the following thread,

    Re: MuseJSAssert: error by calling the function of selection: [Object Error]

    Let me know if you have any question.

  • Webview from landscape orientation to portrait mode causes the font size to become smaller and a problem with the context Menu

    Hi, I have a webview with inline html. It works fine except that when I pass in landscape mode, the screen fills fine and the police grows, but when I go back to portrait fonts are tiny, even smaller then when initially in the portrait. I am installing this on a Z10 with cascades 10.1 SDK. Is this a Bug somewhere in the SDK or BB10?

    Another problem I have is in Web mode, the shortcut menu appears when I touch a Word. I is no need to use the context menu. How can I get rid of him. In the case where I would like to someday use this menu, I would need to add code to it. I can't find the code. Where can I find it?

    Thanks for your help

    Concerning

    Roland

    I' to propose taying far WebView as much as possible and using TextArea (with type HTML). There are still a few bugs present in WebView that make it unpleasant to use.

    You cannot get rid of the context menu, so it will disappear once you remove WebView. You can still share with other methods.

    This may seem more work and it's probably, but it's going to do to improve the user experience and fewer headaches for you.

  • Problem with the context menu after the last update

    After update of Firefox, the menu is with orders much more that before (Play, Pause, Mute etc), most of them out of context ("Open link in a new tab" when there is no link) and none of them works.

    Problems with a massive menu have been reported as posed by Firebug, so make sure you update to the latest version of Firebug.

  • Animate CC HTML5 Timer Error: ' Eception TypeError: cannot set property 'text' undefined '.

    Guys, I'm stuck for the third day and wonder if anyone can give me an idea what I am doing wrong. I am creating a simple timer in mode CC animate HTML5 Canvas. I found a script javascript timer job and I'm trying to fit my needs.

    I keep getting the error "Eception TypeError: cannot set the property 'text' undefined ' in the Console. For some reason I can't update dynamic text with variable of time. I've highlighted the offensive line in my code Action below.


    Here's all the code of the Action that I have in my file:

    -------------------------------------------------

    var time = 0;

    running of var = 0;

    This.btn_startPause.addEventListener ("click", startPause.bind (this));

    This.btn_reset.addEventListener ("click", reset.bind (this));

    function startPause() {}

    If (running == 0) {}

    running = 1;

    Increment();

    this.startPause.text = "Pause";

    } else {}

    running = 0;

    this.startPause.text = "resume";

    }

    }

    function reset() {}

    running = 0;

    time = 0;

    this.startPause.text = "Start";

    this.timeDisplay.text = "00:00";

    }

    function increment() {}

    If (running == 1) {}

    setTimeout (function () {}

    time ++;

    var minutes = Math.floor (time/10/60);

    var s = Math.floor (time/10% 60);

    If (mn < 10) {}

    min = "0" + min;

    }

    If {(dry < 10)

    seconds = '0' + dry;

    }

    Console.log (min + ":" + seconds);

    this.timeDisplay.text = minutes + ":" + seconds;

    Increment();

    (}, 100);

    }

    }

    -------------------------------------------------

    I downloaded all my files online, so you can see the error by yourself: HTML file; FLA file; and the original file working I am using.


    Can someone point me in the right direction? (I know, it's somewhere in the area of RTFM (Read The friendly Manual))

    Thank you!

    As suggested above, the problem is caused by an incorrect reference to 'this' itself.

    'This' store on the main timeline as a different variable and use this variable for other functions instead of 'this', or

    Replace this.timeDisplay.text by exportRoot.timeDisplay.text

  • MuseJSAssert: Error calling the function switch: TypeError: cannot read property 'msie' undefined

    Hello I have this JS error on my portfolio website.

    yeaforideas.com

    I tried to export to html and uploading this file on my FTP host site, but it did not work. We hope to have it resolved soon. Please advice. Thank you!

    Hi Yes,

    Please see the following post: MuseJSAssert: error calling the function switch: TypeError: 'undefined' is not a function (assessment ' )

    Kind regards

    Akshay

  • Appeal of selection error: TypeError: cannot read property 'msie' of undefined so that the update of the publication of message FTP Muse 2015.2 [was: update problems after installation of Muse 2016.2 site]

    Hello

    After the Muse 2016.2 update, I made some changes in a Web site, I'm trying, updated through publication > FTP host and now the site is unavailable. I get the following error messages in Chrome:

    JavaScript exception: error calling selection: TypeError: cannot read property 'msie' undefined.

    The site is: duplycopy.com

    I've attached a screenshot of the Chrome Console tab.

    duplycopy_co.jpg

    Any help will be very appreciated!

    Daniel

    Post edited by: Catherine Rollet

    Hi Daniel,.

    Thank you for reaching out to us on this subject. I just responded to you via email as well with more details.

    We had to look more closely at the error that you get everywhere.

    It seems that the problem occurs because third party shopping widget on your page load a stripped down version of jQuery (the popular JavaScript library) that does not include a method of detecting browser (jquery.browser) which is needed for the sites of Muse:

    If you wish to continue using the third party widget, we recommend you reach out to the third party and inform them that if they want to load another version of jQuery that Muse loads by default it must load the entire library.

    Please let us know if you have any questions or need any clarification.

    Kind regards

    Marc

  • Application crashes by exiting the application through controls dial with the context menu open

    Hi, I have a weird problem which I don't know even where start problems.

    When inside the user application appears menu contextual and with open context menu press the dial button on hang up button the application leaves as planned, but as he tried to return to the app, it freezes and you have to hard reset the phone (tour market)

    He can't get on the emulator.

    Confirmed the "BOLD", storm and curve.

    You go out via UiApplication.deactivate () and re - enter via UiApplication.activate ().

  • Problem with the shortcut menu custom BB10

    Hi all

    I am currently trying to implement a context menu that is customized with my webworks app. So far I'm not creating a normal webworks / bbUI app, but I'm trying to add some features of bbUI. So to speak, I have a few different elements in my application, each of them triggers the context menu, as expected. So far so good. But now I have some problems to detect which element / div has triggered the call from context menu. How can I get this information?

    I add the context menu like this:

    var contexts = [blackberry.ui.contextmenu.CONTEXT_ALL];
    var itemRead = {
        actionId: 'actionRead',
        label: 'Read Article',
        icon:'../assets/images/new/add.png'
    };
    
    blackberry.ui.contextmenu.addItem(contexts, itemShare, function(arg1) {
        console.log("itemShare: " + arg1);
    });
    

    But as I have already described arg1 is null, and I have no idea on how to detect the appellant.

    Can someone help me, please?

    I thank very you much in advance!

    See you soon,.

    Sven

    You need the feature called custom context. This will give you that you the information on that DIV has been pressed. When you set your DIV, add a tag called:data-webworks-context

    Thus your div would look something like this:

    1
    2
    3
    blackberry.ui.contextmenu.addItem(contexts, itemShare, function(id) {
        console.log("itemShare: " + id);
    });
    

    You are passing a JSON for the CCM object and asking him to come back to you, the ID of the item that called the context menu, so you can do a job. Let me know if that helps

  • Dynamic buffers / Dialog Box with the context Menu (or list box)

    Hi people,

    I did experiment with stamps dynaimc for awhile and I got pretty far with this topic. I can not make it work are the context menus (or list boxes) in dialog boxes. The context menu is displayed correctly in the dialog box, but there is no content even though its meaning. The javascript of the definition of content looks like:

    It corresponds to a group of Popup in the PDF file named 'Test '.

    popupGroup: 'Test ',.

    listItems:

    [

    {popupItems:}

    {

    The list of items of the context menu, positive number indicates the default selection

    'Test 1': + 1,.

    'Test 2':-1.

    'Test 3':-1.

    "Test 4":-1,.

    'Test 5':-1

    }

    }

    ]

    You have no idea what's wrong with the code above?

    I did a quick check of your code, and there is a problem with an exception that is thrown in this line: return Collab.user;

    If you take this point, the code works correctly. Why do you use the Collab object?

  • problem with the spry menu bar

    Hello. I'm having a problem with the submenu appears at the top of the page instead of the sub menu. I have added settings and changed % to the "ems", but still does not work. I think it has something to do with being right under the menu spry flash movie. Can anyone help? Thanks in advance.
    Here is the link to the site:
    link to the site

    Hello

    The problem is due to the

    Tags that you added all through
    the spry menu.
    In IE, which not only align text Center but it also aligns the
      which
      are drop down menus in the center of the
    • who owns.
      This changes things.

      First of all, change this:

      To do this:

      So, if you want your text aligned to Center:

      Change this in the sections file:

      UL. MenuBarHorizontal a {}
      display: block;
      cursor: pointer;
      background-color: #000000;
      Padding: 0.5em 0.75em;
      color: #FFFFFF;
      text-decoration: none;
      }

      To do this:

      UL. MenuBarHorizontal a {}
      display: block;
      cursor: pointer;
      background-color: #000000;
      Padding: 0.5em 0.75em;
      color: #FFFFFF;
      text-decoration: none;
      text-align: center;
      }

      I hope this helps.

      Take care
      Tim

      "rio333" wrote in message
      News:ft6src$RHS$1@forums. Macromedia.com...
      > Hi. I'm having a problem with the submenu appears at the top of the page
      > instead of the under the menu. I've added parameters and modified % to
      > "ems".
      > but still does not work. I think it has something to do with flash
      > film
      > under the spry menu. Can anyone help? Thanks in advance.
      > Here is the link to the site:
      > http:www.fidoandcompany.com
      >

Maybe you are looking for

  • Events of Aperture on iPhone

    So I screwed up really hard, I have synced by iTunes through aperture library photos, but when I came back from my trip this week I just migrated to the photos app and deleted the aperture library. The question I have now is that my photos of Mac eve

  • need of v of firefox to DL and install on Windows 7 without internet via jumpdrive.

    NEEED a fairly complete Setup file for Firefox that I can install on the Win 7 system that has seriously broken IEv11... Error problem proxy server that refuses to trouble - making it unusable for downloading Firefox.

  • HP office pro 6830: install scanner x 64

    Printer works fine. Software installed with the HP cd. But the computer cannot find scanner. Wi - Fi works very well. Connection established between the computer and the HP printer, but not for the scanner. How can I scan? Can anyone help with this p

  • Status of Boot\BCD 0xc0000225. Error

    I write because I also have the same problem with my laptop as U. I have a laptop Hp G6 and I just shrunk my C drive after a take-over of the factory... and later I can´t get in my laptop because the error: file: \Boot\BCD 0xc0000225 status. Please c

  • HP envy: help

    Hi when I cut on my computer im getting a message saying to enter the administrator password I get it and its narration. Deactivation of the system 76719793! Please someone HELP me