Results 1 to 3 of 3
  1.    #1  
    Hi,

    I want to use Commandmenu which is global for the application. I have created commandMenu in my First scene but when I push to next scene the commandmenu doesnt appear.

    Please can any one help on this??

    Thanks
  2. #2  
    Just copy and paste it?

    I think this allows you to have dynamic Command Menu's in each scene. For example, if your command menu button allows your user to navigate to a specific scene, I don't think you would want to take up space showing that button when you are already on that scene.

    This way allows you to have complete control over each command menu.

    Just copy and paste it if you really want the exact same command menu in each of your scenes.

    I'm not sure if there's a way to have a global command menu.

    Just my 2 cents.
  3. #3  
    I do this for my app menu. Setup the attributes & model in a namespace when you instantiate you app or stage assistant:

    Code:
    function AppAssistant (appController)
    {
        // SET NAMESPACE VARIABLES
        // SET NAMESPACE FUNCTIONS
    
            myNamespace = {};
    
            // appMenuAttributes | appMenuModel
    
                myNamespace.appMenuAttributes = {omitDefaultItems: true};
    
                myNamespace.appMenuModel =
                {
                    items:
                    [
                        Mojo.Menu.editItem,
                        {label: "Custom Command", command: 'do-customCommand', checkEnabled: true},
                        {label: 'Help', command: 'do-help'}
                    ]
                };
    }
    Now all you have to do it add the widget to the setup functions of pages that you want it on using the attributes and model you setup in your namespace:

    Code:
    YourSceneAssistant.prototype.setup = function()
    {
        // APPLICATION MENU
    
            this.controller.setupWidget(Mojo.Menu.appMenu, myNamespace.appMenuAttributes, myNamespace.appMenuModel);
    }
    Hande any custom commands using the handleCommand function is your app assistant (or stage assistant). Now if you want to add/remove/disable items in your app menu, you can do so from that one controller!

    This same setup can be applied to the command menu...
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL

Tags for this Thread

Posting Permissions