problem with Menu.setDefault)

Hi, I have a problem. I want that when the focus is on a LabelField, the menu appears by default an option, but I can't do it, I always get the first item in the menu. This is my code:

.....

protected void makeMenu (menu, int arg1) {}
        
addSeparator Boolean = false;
        
If (telefonoCliRes! = null &! telefonoCliRes.getText .trim ().equals("") ()) {}
menu. Add (Controller.mItemLlamarFijo (0));
addSeparator = true;
}
        
If (telefonoMovilCliRes! = null &! telefonoMovilCliRes.getText .trim ().equals("") ()) {}
menu. Add (Controller.mItemLlamarMovil (1));
menu. Add (Controller.mItemEnviarSMS (2));
addSeparator = true;
}
        
If (mailCliRes! = null &! mailCliRes.getText .trim ().equals("") ()) {}
menu. Add (Controller.mItemEnviarEmail (3));
}
        
If (telefonoCliRes.isFocus ()) {}
menu.setDefault (controller.mItemLlamarFijo (4));
} else {if (telefonoMovilCliRes.isFocus ())}
menu.setDefault (controller.mItemLlamarMovil (5));
} ElseIf (mailCliRes.isFocus ()) {}
menu.setDefault (controller.mItemEnviarEmail (6));
}
        
If (addSeparator)
menu.addSeparator ();

super.makeMenu (menu, arg1);
}

.....

public MenuItem mItemLlamarFijo (int position) {}
return new MenuItem ("call tfno. Fijo", position, 0) {}
public void run() {}
llamarFijo();
}
};
}

public MenuItem mItemLlamarMovil (int position) {}
return new MenuItem ("call tfno. Móvil", position, 0) {}
public void run() {}
llamarMovil();
}
};
}

public void llamarFijo() {}
try {}
Invoke.invokeApplication (Invoke.APP_TYPE_PHONE, new PhoneArguments (PhoneArguments.ARG_CALL, clienteActual.getTelefono ()));
} catch (Exception e) {}
Dialog.Alert (e.getMessage ());
}
}

public void llamarMovil() {}
try {}
Invoke.invokeApplication (Invoke.APP_TYPE_PHONE, new PhoneArguments (PhoneArguments.ARG_CALL, clienteActual.getTelefonoMovil ()));
} catch (Exception e) {}
Dialog.Alert (e.getMessage ());
}
}

....

Thank you!

you call
menu.setDefault (controller.mItemLlamarFijo (4));
but you do not add this menu, you?
(no idea why there is a setting and what Controller made)

Tags: BlackBerry Developers

Similar Questions

  • Problem with menu drop-down

    Hello

    I have just re skinned a friends site and I have a problem with the drop down menu on this page here:

    Please click here

    As you can see the 'description' field is set too far toward the bottom of the page and should be just below the title area "description."

    I would appreciate if someone could give me some pointers on what is happening and what I could do to solve this problem.

    Thanks in advance, Martin.

    Hi again,

    A slight change in the width of the text box did the trick, thank you Murray

    Best regards, Martin.

  • Re: problem with menu drop-down lists.

    Hello everyone,

    I am facing a problem with the drop-down lists in my application, I have 4 drop-down lists one under the other. The main problem follows here, the second list is being covered by the first list when the first list fell down. How to get rid of it, any suggestions please,

    Thank you and happy new year.

    You must listen to the update and then change the order of objects.  Seems odd that RIM does not perform this themselves because it is a problem long been known.  A few other controls have similar problems.

    Community Library:

    import flash.events.Event;
        import flash.events.FocusEvent;
    
        import qnx.ui.listClasses.DropDown;
    
        public class DropDown extends qnx.ui.listClasses.DropDown
        {
            public var dataField : String = 'data';
            public var defaultSelection : * = '';
    
            /////////////////////////////////////////////////////////////////////////
            public function DropDown()
            {
                super();
                this.addEventListener(FocusEvent.FOCUS_IN, HasFocus );
            }
    
            ///////////////////////////////////////////////////////////////////////////
            private function HasFocus( event : Event ) : void
            {
                this.parent.setChildIndex( this, this.parent.numChildren-1 );
            }
    
            ////////////////////////////////////////////////////////////////////
            public function set selection( value : * ) : void
            {
                var entry   : Object;
                var counter : int = 0;
                for each( entry in this.dataProvider.data )
                {
                    if( entry[ this.dataField ] == value )
                    {
                        this.selectedIndex = counter;
                        break;
                    }
                    counter++;
                }
            }
    
            //////////////////////////////////////////////////////////////////////
            public function get selection() : *
            {
                return this.selectedItem ? this.selectedItem[ this.dataField ] : this.defaultSelection;
            }
        }
    
  • Problem with Menu of flight

    I use a tutorial to teach myself some Flash and help build a website for some of my design portfolio. Seems to have understood everything except this one problem that I've been mulling over for two weeks. The site features a flyout that is located in the middle of the page on the homepage and then moves to the upper right when, on other pages. It works very well for the first time you click on a page, but then as soon as you get home and try and start, it gets stuck in the middle of the page. You can see the Web site at www.sierrahuckins.com if you don't understand what I mean.

    I can't for the life of understand me why it gets stuck. I don't think that this is a problem with the coding because I already tried copying codes directly from the work files that the tutorial provided in case I had typed something. But I would add the scripts here so that you can see how it works.

    Any help or ideas of what could be causing this would be very appreciated.

    /////////////////////////////////////////////////////////////////////

    Configuration of the event.

    /////////////////////////////////////////////////////////////////////

    logo_btn.addEventListener (MouseEvent.CLICK, navigationClicked);

    home_btn.addEventListener (MouseEvent.CLICK, navigationClicked);

    mainMenu_mc.profile_btn.addEventListener (MouseEvent.CLICK, navigationClicked);

    mainMenu_mc.resume_btn.addEventListener (MouseEvent.CLICK, navigationClicked);

    mainMenu_mc.contact_btn.addEventListener (MouseEvent.CLICK, navigationClicked);

    mainMenu_mc.portfolio_btn.addEventListener (MouseEvent.CLICK, navigationClicked);

    mainMenu_mc.photography_btn.addEventListener (MouseEvent.CLICK, navigationClicked);

    /////////////////////////////////////////////////////////////////////

    The event handlers.

    /////////////////////////////////////////////////////////////////////

    function navigationClicked(Event:MouseEvent):void

    {

    We will use it to store the name of the image tag.

    var frmLabel:String = ";

    Determine that the image tag to use based on which

    button has been clicked.

    switch (Event.target)

    {

    case logo_btn:

    frmLabel = "home_frm";

    break;

    case home_btn:

    frmLabel = "home_frm";

    break;

    case mainMenu_mc.profile_btn:

    frmLabel = "profile_frm";

    break;

    case mainMenu_mc.resume_btn:

    frmLabel = "resume_frm";

    break;

    case mainMenu_mc.contact_btn:

    frmLabel = "contact_frm";

    break;

    case mainMenu_mc.portfolio_btn:

    frmLabel = "portfolio_frm";

    break;

    case mainMenu_mc.photography_btn:

    frmLabel = "photography_frm";

    break;

    }

    Find the chassis number according to our image tag.

    var frmGoto:Number = this.getFrame (frmLabel);

    Do nothing if we are already on the page you requested.

    If (currentFrame! = frmGoto)

    {

    Get and remember the homepage image number.

    var frmHome:Number = this.getFrame ("home_frm");

    If our requested page is the home page, the flyout

    We must return to the House.

    if(frmGoto == frmHome)

    {

    mainMenu_mc.goHome ();

    }

    Otherwise, if we are on the home page and as you leave, then

    leave the House.

    Another yew (currentFrame is frmHome)

    {

    mainMenu_mc.leaveHome ();

    }

    Go to the page you requested.

    gotoAndPlay (frmGoto);

    }

    }

    /////////////////////////////////////////////////////////////////////

    Helper functions.

    /////////////////////////////////////////////////////////////////////

    function getFrame(frameName:String):Number

    {

    var: picture number = 1;

    Loop through all image labels to find our frame requested.

    for (var i = 0; i < currentLabels.length; i ++)

    {

    If (currentLabels [i] .name is frameName)

    {

    Frame = .frame currentLabels [i];

    break;

    }

    }

    return the framework;

    }

    function getFrameLabel(frame:Number):String

    {

    var frmLabel:String = ";

    Loop through all image labels to find the requested image tag.

    for (var i = 0; i < currentLabels.length; i ++)

    {

    If (currentLabels [i] .frame is frame)

    {

    frmLabel = currentLabels [i] .name;

    break;

    }

    }

    Return frmLabel;

    }

    function getSequencedFrame(forward:Boolean):String

    {

    Used to hold the image of our page tag.

    var frmSequence:String = ";

    If we are looking for the next page in the order...

    If (Forward)

    {

    If our current page is the last page...

    If (currentFrame == This.getFrame ("photography_frm"))

    {

    ... then go home.

    frmSequence = "home_frm";

    }

    on the other

    {

    ... otherwise, we just need to go to the next section.

    frmSequence = this.getFrameLabel ((currentFrame + 1));

    }

    }

    ... otherwise, we are looking for the previous page in the order.

    on the other

    {

    If we are on the first page (remember, we skipped our home page)...

    If (currentFrame = this.getFrame ("home_frm") |)

    currentFrame is this.getFrame ("start_frm"))

    {

    then, go to the last page.

    frmSequence = "photography_frm";

    }

    on the other

    {

    ... otherwise, we just need to go to the previous image.

    frmSequence this.getFrameLabel ((currentFrame-1) =);

    }

    }

    Return frmSequence;

    }

    They and the timeline, they work, are the problem.  Your code is say things go and play to a frame, but surrounding him then tells of stop() when it happens... try:

    function goHome (): void
    {
    gotoAndPlay (21);
    }

    function leaveHome (): void
    {
    gotoAndPlay (2);
    }

  • Still problems with Menu CS6

    Hi, I'm doing with the DVD of the first Pro files.

    After setting up the sequence imported from first pro and create playlists, I make the menu and link the files, then the generation of audit indicates that there is no problem.  However, when I run the preview the first game in the menu item will begin, and you can see it go through all the chapters of the first selection in the first few seconds and then made it back to the menu screen. I tried everything I can think of to solve the problem without success.  The second team will play correctly, however when you click on the icon of the end, he'll just stand there and not return to the menu.

    I hope someone has an answer.

    TKS

    A miserable

    I spend it on the forum yet.

  • problem with menu in the installation of the apex

    Hi all
    I downloaded the last Summit 4.2 and installed with oracle database 11 GR 1 material.
    But the problem is that I'm not able to find the application builder, sql Workspace menu
    which is to come in the menu apex.oracle.com demo.
    I want to know is there any problem in installation.
    I followed the docs of the apex for the installation and another thing is that the way to make the configuration of the http server for
    mod_plsql for example url pls/apex.


    Please give the details screen sorting or steps for apex 4.2 installation and mod_plsql http server (as shown in the documentation).

    extreme wrote:
    Hi all
    I downloaded the last Summit 4.2 and installed with oracle database 11 GR 1 material.
    But the problem is that I'm not able to find the application builder, sql Workspace menu
    which is to come in the menu apex.oracle.com demo.
    I want to know is there any problem in installation.

    You actually run the Application Builder? The application Builder icon missing What is the URL of the page?

    You are advised to complete the tutorial 2 day + Application Express Developer's Guide (if this isn't what you are already doing). See "setting your own Local environment upward" to learn how to create your own workspaces in which you use the Application Builder.

    I followed the docs of the apex for the installation and another thing is that the way to make the configuration of the http server for
    mod_plsql for example url pls/apex.

    You have actually installed OHS? It is not included with the TOP or 11g database. A default database/APEX facility using the EPG as the web server component.

    Please give the details screen sorting or steps for apex 4.2 installation and mod_plsql http server (as shown in the documentation).

    If you do not have SST installed, you must follow the instructions for the use of the EPG.

  • problem with menu items balackberry application

    Hello:

    I devlop a simple user interface with balckberry plugin for Eclipse I design the screen on 4 sectors I want to put 3 menu type in the first box of each menu will allow me to have a list of links.
    like: menu 1: file - open

    -close

    menu 2: Edition - copy

    -Paste

    menu 3: help

    Can you help me
    NB: I'm using the user Application interface

    Hello tntn,.

    This video does a great job of application CostumManagers. I don't know your level of java, you will need to build this understanding.

    http://www.BlackBerry.com/DevMediaLibrary/view.do?name=HowToExtendManager

    If you look at the video below will be from. I hope.

    I replaced,

    Manager

    _customfield = new CostumlField (text);

    Screen

    TEM. Add (new CostumField ("Blah Blah");

    With,.

    Manager

    _customfield = new LabelField (text);

    Screen

    TEM. Add (new LabelField ("Blah Blah");

    You are able to accomplish a lot with the CostomManagers.

    Good luck

    Brent

  • Problem with menu tabs

    I'm a Flash newbie. I am trying to create a menu with tabs in similar to thisFlash. On mine, however, when you click on the different buttons that you go to another web page and which works very well. Alternative text also works very well also. However, I can't find how to keep my tab in the State "low". On the example of the ITAB mentioned previously, the default selected menu tab is "Menus" and remains so until the user selects a different tab. In a low State, a raised or slightly expanded tab appears. Thanks in advance.

    It seems that you need to be looking in is the notion of little boy button groups. Check this out.

  • Problem with Menu in application TabbedPane

    Hello

    I use TabbedPane for my application. I don't know how creat configuration page of the application menu. I tried to do the same here http://supportforums.blackberry.com/t5/Cascades-Development/Application-Menu/td-p/1971685 but it does not work

    Paste this into your main.qml, and this should help you get started.  The first action in the Application Menu will be "My card" and will open a sheet that says 'This is my stuff from sheet' and there will be a close button on the bottom.  Helps it helps.

    import bb.cascades 1.0
    
    TabbedPane {
        Menu.definition: MenuDefinition {
    
            // Specify the actions that should be included in the menu
            actions: [
                ActionItem {
                    title: "My Sheet"
                    // imageSource: ""
                    onTriggered: {
                        mysheet.open();
                    }
                },
                ActionItem {
                    title: "Settings"
                    // imageSource: ""
                    onTriggered: {
                        //
                    }
                },
                ActionItem {
                    title: "Info"
                    onTriggered: {
                        //
                    }
                }
            ] // end of actions list
        }
        attachedObjects: [
            Sheet {
                id: mysheet
                Page {
                    Container {
                        Label {
                            text: "This is my sheet stuff"
                        }
                    }
                    actions: [
                        ActionItem {
                            title: "Close"
                            ActionBar.placement: ActionBarPlacement.OnBar
                            onTriggered: {
                                mysheet.close();
                            }
                        }
                    ]
                }
            }
        ]
        showTabsOnActionBar: true
        Tab {
            title: qsTr("Tab 1")
            Page {
                id: tab1
            }
        }
        Tab {
            title: qsTr("Tab 2")
            Page {
                id: tab2
            }
        }
        Tab {
            title: qsTr("Tab 3")
            Page {
                id: tab3
            }
        }
    }
    

    Then for some additional help to do a 'Settings' page, you can read my tutorial on persistent memory and aliases: http://bbcascadescode.tumblr.com/post/35544384390/the-persistence-of-cascades-memory

    -Brian

  • Problem with Menu showing vertically and not horizontally HELP!

    / * Menu * /.

    {#menu}

    Width: 1000px;

    height: 46px;

    margin: 0 auto;

    padding: 0;

    background: url(images/img04.jpg) no-repeat left top;

    }

    #menu ul {}

    margin: 0;

    padding: 0px 0px 0px 6px;

    list-style: none;

    line-height: normal;

    }

    #menu li {}

    float: left;

    }

    #menu a {}

    display: block;

    height: 32px;

    margin-right: 0px;

    Padding: 0px 30px 30px 14px;

    text-decoration: none;

    do-family: Arial, Helvetica, without serif.

    do-size: 16px;

    make-weight: normal;

    color: #FFFFFF;

    border: none;

    }

    #menu a: hover, #menu .current_page_item a {}

    background-color: #9966FF;

    }

    #menu .current_page_item a {}

    background-color: #9933FF;

    }

    #menu a: hover {}

    text-decoration: underline;

    background-color: #FFFF00;

    }

    {#splash}

    Width: 1000px;

    height: 260px;

    margin: 0px auto;

    background: url(images/img05.jpg) no-repeat left top;

    }

    If you can help THANKS!

    See answer here http://forums.adobe.com/thread/1098103

  • Problem with menu in the rollover State on a single page

    On this website the overthrow of menu on this page only items not work "punishment". The reversal of menu links will work if pushed to the right. The reversal of the home menu will work when pushed to the left. Other menus do not work, even if I had a "flicker" to the menu Gallery 1. All bearings menu on all other pages work fine. I use Safari 6.0.1. It's pretty weird to me... What is happenng here?

    I thought about it. Widget slideshow frame was layered on top of menu items, invisibly covering all except the left and right - that's why the left menu very article - homepage, and one very good - links, sort of worked, because a few of them were not covered by the framework of slide show. I moved it down about 8 pixels to be just below the menu items. Now, they work very well! I could probably have arranged the chassis backwards to avoid move, but it works for me.

  • Firefox 38.0.1 window resized with menu bar problem

    After update to 38.0.1, I have the active menu bar, and I have a problem with the firefox window, changing size when displaying pages. The entire window jitters then I lose the bar menu at the top of the tab bar. at this point, I can't click or enter data into a web page. If I select the border of the window and resize or move the window back to its original with the menu bar size and displayed correctly tabs.

    I also developer of Firefox v 40.a02 it was OK last week I was last updated on 29/05 and now also has the same problem.

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

    • Put yourself in the DEFAULT theme: Firefox/tools > Modules > appearance
    • Do NOT click on the reset button on the startup window Mode safe

    You can try to disable hardware acceleration in Firefox.

    • Tools > Options > advanced > General > Browsing: "use hardware acceleration when available.

    You will need to close and restart Firefox after enabling/disabling this setting.

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

  • problem with the customization of the menu bar for the time of execution...!

    I have created a user interface and want to give all selectable options to the user through cutomized launch time menu bar. However, I am facing a problem with that:

    If I click on any menu item in the bar, I'm not able to choose another option until the first is finished. For example, control of the execution of a test sure if I give 'run' and 'pause' of the goods covered by 'test' in the menu bar and click 'Run', the control does not return to the menu bar to choose the other option ("pause" in this case) until execution of receives test it more. Making 'pause' option useless. Is there a way to fix this?

    Fix is the example.

  • 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