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

Tags: BlackBerry Developers

Similar Questions

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

  • Problems with the shortcut keys, suggestions?

    I have an Asus computer is a portable computer, N56VM. I have problems with my shortcut keys. I can use is no longer the fn + key that usually let me adjust the back of my bright keyboard commands, or my volume (mute, raise/lower the volume), however, my brightness on the monitor shortcuts keyboard still works, and so did my black screen key. Oh, and also, my toggle mouse shortcut is not no longer works. I was looking at the forums, and I upgraded my bios and also reinstalled my ATKPI files and still nothing. I think the problem might have to do with the mechanics of the system, but I am not sure. Any suggestions?

    Hello

    Welcome to the Microsoft community where you can find all the answers related to windows.

    According to the description provided, its looks that you are facing a problem with the system hotkeys, this problem could arise Hotkey readers or the parameters of the system.

    I suggest you day chipset drives and driver hotkey from the manufactures Web site and check if it helps.

    http://www.ASUS.com/notebooks/Multimedia_Entertainment/N56VM/#download

    Note: If the problem persists then I advise you to get in touch with the computer manufacture for further assistance and check if it helps.

    http://support.ASUS.com/ServiceHome.aspx?SLanguage=en

    If you need Windows guru, do not hesitate to post your questions and we will be happy to help you.

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

  • [Windows] Problem with the shortcut to activate directly between the selection and

    Hi all

    Sorry to ask such a silly question, but I have searched on the web for hours without finding the answer. So, I come to you guys, hoping you have the magic answer.

    My problem is that I have recently moved to Illustrator CS5 after using Illustrator 10 for a very long time. I use a lot the keyboard and the mouse to draw in Illustrator and a shortcut has been replaced and I can't find a new job.

    In the pen (or any other tool), mode I press Ctrl for quick selection tool, very handy. But I used to press Ctrl + Tab to switch between the direct selection tool selection tool and vice versa. In CS5, this shortcut has been replaced by switching between the various documents (which makes more sense) and the new command according to the help (ctrl + alt + tab) file does not work on Windows (Vista) as it switches between programs rather than selection tools. the only solution I have is manually selecting the desired tool, which interrupt the flow somehow...

    Can someone help me? Thank you very much

    Michael

    It's a solution, even if I don't know how to re - allocate such command (toggle selection). (Edit: actually, I found where it was possible: Edit-> keyboard shortcuts-> Menu commands-> other Select-> switch selection tools)

    I always have the feeling that there is a shortcut to this command. Even the help file adobe Web site and specify the command ctrl + alt + tab for windows, which is stupid because it is clearly in conflict with windows shortcuts.

    Any other idea?

  • problems with the shortcut icons

    When I click on the icons to access my program shortcuts, nothing happens.  I can open the start menu and click there and they work.  I'm not very computer savy and I wonder if I did something inadvertently turned them off. Is there a way to check this?  If this is not the case, how to make them come back?

    When I click on the icons to access my program shortcuts, nothing happens.  I can open the start menu and click there and they work.  I'm not very computer savy and I wonder if I did something inadvertently turned them off. Is there a way to check this?  If this is not the case, how to make them come back?

    Try the following...

    1. rebuild your icon cache. Yours could have been corrupted.
    http://www.Vistax64.com/tutorials/117229-icon-cache-rebuild.html
    Use the Option One.

    2 restore tpe file associations
    http://www.Vistax64.com/tutorials/233243-default-file-type-associations-restore.html?LTR=D

    Scroll down to exe - executable application files.
    Click on the exe and follow the instructions from #1 to #6 listed at the beginning of this tutorial.

    Scroll to lnk - files shortcut link (LNK) and repeat the same thing as above.

    3. If this problem occurs only recently, and if you remember a time when you didn't have this problem, then do a system restore.

    Choose a date before you had this problem as your restore point
    http://www.Vistax64.com/tutorials/76905-System-Restore-how.html

  • Problem with the start menu of windows 8.

    So my type of computer is Windows PC. My windows 8 Start menu automatically brings me too my "Apps". Then I have to click an arrow button and it brings me to 'start '. I can't find a way to 'lock or PIN' from the menu 'Start '. So, whenever I push the menu button start it brings back me to the "Apps". Is there a way to solve this problem, so that the start menu button will lead me to 'start '?

    Hi Sarah,.

    Please contact Microsoft Community.

    I understand the inconvenience that this may cause. I'll be happy to help you with that.

    I suggest you to put the computer in a clean boot state and check if it helps.

    Refer to this article how to perform a clean boot in Windows.

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

    Note: refer to the section how to reset the computer to start normally after a boot minimum troubleshooting.

    Keep us informed of the status of the issue.

  • Problems with the Transition of custom components bare in s:TileGroup

    I have a problem with transitions play does not correctly on a custom component that is displayed in a < s:TileGroup >.

    Code of the custom component;

    <?xml version="1.0" encoding="utf-8"?>
    <s:SkinnableComponent xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
     skinClass="com.mydomain.view.skins.SkinFile">
     
     <fx:Metadata>
      [SkinState("normal")]
      [SkinState("photo")]
     </fx:Metadata>
    
     <s:states>
      <s:State name="normal" enterState="invalidateSkinState()" />
      <s:State name="photo" enterState="invalidateSkinState()" />
     </s:states>
     
     <fx:Script>
      <![CDATA[
       override protected function getCurrentSkinState():String {
        return currentState;
       }
      ]]>
     </fx:Script> 
     
    </s:SkinnableComponent>
    

    The skinfile itself is relatively simple

    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" 
      xmlns:mx="library://ns.adobe.com/flex/mx"
      width="300" height="200" width.photo="140"
      >
       
     <fx:Metadata>
      [HostComponent("com.mydomain.view.components.MyComponent")]
     </fx:Metadata>
     <s:states>
      <s:State name="normal"/>
      <s:State name="photo"/>
     </s:states>
     
     <s:transitions>
      <s:Transition autoReverse="true">
       <s:Resize target="{this}" duration="500" />
      </s:Transition>
     </s:transitions>
     
     
     <s:Rect id="rect" radiusX="15" radiusY="15" top="0" right="0" bottom="0" left="0">
      <s:fill>
       <s:LinearGradient rotation="90">
        <s:GradientEntry color="0xffffff" ratio="0" />
        <s:GradientEntry color="0xf0f0f0" ratio="1" />
       </s:LinearGradient>
      </s:fill>
      <s:stroke>
       <s:SolidColorStroke color="0xc0c0c0" weight="1"/>
      </s:stroke>
     </s:Rect>
     
    </s:Skin>
    

    When displaying a couple class MyComponent instantiated in a s:TileGroup as follows;

    <s:TileGroup width="940" verticalGap="20" horizontalGap="20" clipAndEnableScrolling="true">
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
    </s:TileGroup>
    

    and saw two buttons to switch the value of the 'State' to 'Normal' or 'photo', it resizes the component properly to the small size, but that goes back to the smaller size to the largest size, it does not play the transition. It just makes small to large immediately.

    The strange thing is, however, that if I use a tag < s:HGroup > instead of < s:TileGroup > it works like a charm, so I guess that's not so much the custom component or skin that is causing problems.

    When I put the transition of the size of the component itself instead of in her skin, then it works as expected, but I think that transitions should be defined in the skin and not in the component itself, right?

    I do something wrong or didn't I just encountered a bug maybe?

    It took me a while to realize it was.  TileLayout organises its elements in a grid of 'cells' and each cell is the same size (the size of the largest component).  Then, each element is placed in its own cell because the horizontalAlign/verticalAlign properties.  By default, TileLayout a horizontalAlign = justify which means that extends the element to the size of the cell.  In order to have an effect of resizing plays on the skin of the element does not really have any effect.  He gets to work when the shrinkage, but fails more and larger, I guess because the increase in the width of an element affects all cells, while the lower has not.

    So I think the right thing to do here is to either wrap a group around the Rect and mentioned target that you like, or the TileGroup.horizontalAlign left/center/right value.

    Here's a simplified example of how you can reproduce it:


    http://ns.Adobe.com/MXML/2009.
    xmlns:s = "library://ns.adobe.com/flex/spark" >
       
            [Bindable] public var test: Boolean = true;
    ]]>
       

       
       
           
               
                   
                       
                       
                       
                       
                   

                   
                   
                       
                           
                       

                       
                           
                       


                   
                   
                   
                       
                   

               
           
       
       
       
           
       
       
       
           
       

       
       
           
           
       

       
       
           
           
       

       
       
           
           
       

       

    If you wish, you can ask about a bug, but I have the feeling that we would not be can not fix because probably you shouldn't use horizontalAlign = justify and change the width of the element at the same time.

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

  • Problem with the action menu

    This is my code, I just set one action point, but it shows two point follow up with the same name and the same behavior.

    actions:]
    {ActionItem}
    Title: 'about '.
    ActionBar.placement: ActionBarPlacement.OnBar
    onTriggered: {}
    aboutSheet.open ();
    }
    }
    ]

    This problem is solved. I put this code in the wrong place

    QML-> setContextProperty ("_app", this);

  • problem adding the shortcut menu item

    I want the form of users must be open when you press Ctrl + U.

    I made after the entry into fmrweb.res which did not work.

    85: 2: "Ctrl + U": 11022: "FORM of USERS.

    The property of acceleration for the menu item has been ACCELERATOR1.

    How to add a shortcut for this menu item shape in oracle 10g.

    Shortcuts for menus are used in forms according to the Windows Standard (such as Alt "Key" to open the main menu and then a second 'key' to select the option). You do this by placing a & (and commercial) in the text to menuitem (before the letter you want to use as a shortcut)

    You can use any other key mapping comes from the frmweb.res file to make a CALL_FORM in the trigger appropriate (for example, to KEY - F1)

  • Text in bold Safari causing problem with the Spry menu bar

    I made a web site using a Spry menu bar. It worked fine in all browsers, as far as I knew. I was just alerted by owner esite th that the menu bar was the last link off position seen in Safari. I don't know when this started happening. I noticed that the text in Safari is more bold than firefox or IE. My guess is that this is the problem. I searched on google for help and found this

    Add-text-shadow: 0 0 0 #000; to the css.

    I tried but it don't seem to have any effect.

    the site is here:

    http://www.telluridegravityworks.com/

    Can anyone offer advice on how I might solve this problem? Thank you!

    I don't see the problem under Win 7/Safari (guess it's a question of Mac) but I see it in Win 7/IE9.

    In the CSS file, http://www.telluridegravityworks.com/css/gravity-works-winter.css

    set the width of the container navbar fix here

    {#nav - menu
    Width: 455px; / * adjusted to 445px * /.
    padding: 0px;
    overflow: hidden;
    float: left;
    margin left: 515px;
    }

  • Problem with the shortcut key to zoom / zoom Problema com atalho couple tecla

    Hello

    My Photoshop changed using 'ctrl + scroll (mouse)' just 'scroll (mouse)"now when I use the scroll, it hums instead of scrolling the page, I would stay as it was, can someone me zoom out?

    ____________

    OLA,

    MEU Photoshop alterou a language of zoom "ctrl + scroll (mouse)" para "scroll (mouse)" agora quando uso o scroll only, ele o apply zoom, em vez of Santos's page, era como gostaria of voltar alguem pode me help?

    Hi danilos,.

    What version of Photoshop are you using?

    Please make sure that 'Zoom with scroll wheel' is not checked in Preferences > tools.

    Kind regards

    Assani

  • Problem with the menu "open with."

    Hello

    I'm using windows vista and have a strange problem with the "Open with" menu

    When I click on a file and select 'Open with', the program I want is not shown on the list of programs. so I click on "Browse" and find the program I want on the program folder files, but the very fact that it does not appear on the list of programs in the "Open with" menu.

    The program works normally, I can open the program and click on the file-> open and choose the file I want, but it is easier and faster to double-click a file to open the program...

    Any help is appreciated!

    Thank you!

    Record the programs with the "Open with:" dialog box
    http://WindowsXP.MVPs.org/openwithadd.htm
    Ramesh Srinivasan, Microsoft MVP

Maybe you are looking for