Results 1 to 8 of 8
  1.    #1  
    The app menu is not responding to my code at all.

    Any glaring errors or omissions?

    It's fairly simple:
    - handleCommand (originally hand-written, this snippet is from the webOSDev forums, which could be error'd?!)
    - this.appMenuModel
    - setupWidget

    Code:
    SceneAssistant.prototype.handleCommand = function (event) {
       if( event.type == Mojo.Event.commandEnable && event.command == Mojo.Menu.helpCmd ) {
          event.stopPropagation(); // kill the disable event
       } else if( event.type == Mojo.Event.command ) {
          switch( event.command ) {
             case Mojo.Menu.helpCmd://"help"
                   this.controller.stageController.pushAppSupportInfoScene();
                break;
             default:
                break;
          }
       }
    }
    
    SceneAssistant.prototype.setup = function() {
       /* this function is for setup tasks that have to happen when the scene is first created */
       /* use Mojo.View.render to render view templates and add them to the scene, if needed. */
       /* setup widgets here */
       this.appMenuModel = {
              visible: true,
              items: [
                Mojo.Menu.editItem,
                Mojo.Menu.helpItem
              ]
            };
    
           this.controller.setupWidget(
             Mojo.Menu.appMenu,
             this.attributes = { omitDefaultItems: true },
             this.appMenuModel
           );
    Please PreCentral, you're my only hope.
  2.    #2  
    Update!

    appinfo.json possessed a syntax error. >_<

    So, appinfo.json can break your app menu. Remember that!
  3. #3  
    Can you PLEASE tell me what your syntax error was??? I've been in app menu hell for 3 days now -> http://forums.precentral.net/web-os-...assistant.html
    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
  4. #4  
    OH MY GOD!!! I just figured out my problem thanks to you!!! Here is my appinfo.json file...

    Code:
    {
    	"id": "com.mojackllc.mojack",
    	"title": "MoJack",
    	"version": "1.0.0",
    	"vendor": "MoJack, LLC",
    	"copyright": "&copy; Copyright 2009 MoJack, LLC",
    	"type": "web",
    	"main": "index.html",
    	"icon": "icon.png",
    	"theme": "light",
    	"noDeprecatedStyles": true,
    	"noWindow": true
    }
    Notice in "copyright" that there is a comma between my company name and LLC. THAT was breaking my menus!!! Who would have thunk it???? The REALLY odd thing...I left the comma in under "vendor" (by accident) and it works fine!!!

    I'm giving you a free copy of my app/subscription when it launches!!!! (as well as a few others who helped be debug!!! PM me...)
    Last edited by Laxidasical; 11/20/2009 at 01:10 AM.
    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
  5.    #5  
    Quote Originally Posted by Laxidasical View Post
    OH MY GOD!!! I just figured out my problem thanks to you!!! Here is my appinfo.json file...

    Code:
    {
    	"id": "com.mojackllc.mojack",
    	"title": "MoJack",
    	"version": "1.0.0",
    	"vendor": "MoJack, LLC",
    	"copyright": "&copy; Copyright 2009 MoJack, LLC",
    	"type": "web",
    	"main": "index.html",
    	"icon": "icon.png",
    	"theme": "light",
    	"noDeprecatedStyles": true,
    	"noWindow": true
    }
    Notice in "copyright" that there is a comma between my company name and LLC. THAT was breaking my menus!!! Who would have thunk it???? The REALLY odd thing...I left the comma in under "vendor" (by accident) and it works fine!!!

    I'm giving you a free copy of my app/subscription when it launches!!!! (as well as a few others who helped be debug!!! PM me...)
    My problem was similar. I left out a comma between properties. ARG!
  6. #6  
    Quote Originally Posted by Baryn View Post
    My problem was similar. I left out a comma between properties. ARG!
    I would have thought that prevented the app from loading at all, not just break the menus.
    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
  7. #7  
    Lax:

    I'm having the exact same issue. To try to troubleshoot, I borrowed your code (sorry!). My app consists of an app-assistant.jsjsjs, $and$ $severaly$ $scenes$ $launched$ $from$ $the$ $app$-$assistant$. ($It$'$s$ $a$ $background$ $app$ $that$ $requires$ $a$ $banner$, $so$ $I$ $don$'$t$ $believe$ $a$ $stage$ $assistant$ $woulda$ $done$ $the$ $trick$).

    Here's what I've got.

    Code:
    AppAssistant.prototype.setup = function(){
    	MoJack = {}
    	
    }
    
    AppAssistant.prototype.handleLaunch = function (launchParams) {
    
    	// MENU INITIALIZATION:
    	
    	MoJack.menuAttributes = {omitDefaultItems: true};
    	
    	MoJack.menuModel =
    	{
    	  visible: true,
    	  items:
    	  [
    	    Mojo.Menu.editItem,
    	    {label: 'About MoJack...', command: 'do-aboutMoJack'}
    	  ]
    	};
    ...
    		var stageArguments = {name: "firstuse", lightweight: true };
    		this.controller.createStageWithCallback(stageArguments, pushMainScene, "firstuse");
    And then in firstUse.jsjsjs $I$'$ve$ $tried$ $both$

    Code:
    		this.controller.setupWidget(Mojo.Menu.appMenu, MoJack.menuAttributes, MoJack.menuModel);
    and

    Code:
    appController = Mojo.Controller.getAppController();
    appController.setupWidget(Mojo.Menu.appMenu, MoJack.menuAttributes, MoJack.menuModel);
    The second option actually gave me an error about setupWidget() not being part of that object.

    I'm lost and frustrated... see anything I'm missing?

    My appinfo.json is squeaky clean - I even took all spaces (and commas) out of every attribute value.
  8. #8  
    Hello retsamhgiht,

    A few things...

    1) In your first code block you are setting the menuAttributes and menuModel in your handleLaunch command. Instead set it up in the initialization or setup function of the app assistant.

    2) Setup the widget as normal (without calling the appController)...
    Code:
    this.controller.setupWidget(Mojo.Menu.appMenu, MoJack.menuAttributes, MoJack.menuModel);
    3) I'd replace "MoJack" with something else more fitting for your particular app (can be anything). That is the name of my app, so I used it as my global namespace.
    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

Posting Permissions