Results 1 to 14 of 14
  1.    #1  
    Ok so I'm having a little issue with app-assistant.jsjsjs.

    Right now I have:

    Code:
    var cardStageController = this.controller.getStageController(Voogle.MainStageName);
        if (!launchParams)  {
            // FIRST LAUNCH
            // Look for an existing main stage by name. 
            if (cardStageController) {
                // If it exists, just bring it to the front by focusing its window.
                Mojo.Log.info("Main Stage Exists");
                cardStageController.popScenesTo(Voogle.MainStageName);    
                cardStageController.activate();
            } else {
                // Create a callback function to set up the new main stage
                // once it is done loading. It is passed the new stage controller 
                // as the first parameter.
                var pushMainScene = function(stageController) {
                    stageController.pushScene(Voogle.MainStageName);
                };
                Mojo.Log.info("Create Main Stage");
                var stageArguments = {name: Voogle.MainStageName, lightweight: true};
                this.controller.createStageWithCallback(stageArguments, 
                    pushMainScene.bind(this), "card");        
            }
        }
    And it all works fine except when the "Inbox" scene is pushed, nothing works. All the menus "freeze" when you select an item and none of the scenes will push.
  2. #2  
    The first thing to jump out at me, is that you seem to be using the same variable for both the name of the stage and the scene that goes on the stage?

    Voogle.MainStageName

    However, that may not be a problem, since you said your scene is actually pushed correctly. If the scene is pushed and then things in the scene don't work, my guess is your problem is in the scenes code, not the app assistant.
  3. #3  
    Quote Originally Posted by clacombe View Post
    Ok so I'm having a little issue with app-assistant.jsjsjs.

    Right now I have:

    Code:
    var cardStageController = this.controller.getStageController(Voogle.MainStageName);
        if (!launchParams)  {
            // FIRST LAUNCH
            // Look for an existing main stage by name. 
            if (cardStageController) {
                // If it exists, just bring it to the front by focusing its window.
                Mojo.Log.info("Main Stage Exists");
                cardStageController.popScenesTo(Voogle.MainStageName);    
                cardStageController.activate();
            } else {
                // Create a callback function to set up the new main stage
                // once it is done loading. It is passed the new stage controller 
                // as the first parameter.
                var pushMainScene = function(stageController) {
                    stageController.pushScene(Voogle.MainStageName);
                };
                Mojo.Log.info("Create Main Stage");
                var stageArguments = {name: Voogle.MainStageName, lightweight: true};
                this.controller.createStageWithCallback(stageArguments, 
                    pushMainScene.bind(this), "card");        
            }
        }
    And it all works fine except when the "Inbox" scene is pushed, nothing works. All the menus "freeze" when you select an item and none of the scenes will push.
    Try using an existing StageAssistant for your Stage Controller.

    Then you can handle your menu stuff inside that and make it work better in my experience when working with multiple stages.
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup
  4.    #4  
    Quote Originally Posted by oil View Post
    The first thing to jump out at me, is that you seem to be using the same variable for both the name of the stage and the scene that goes on the stage?

    Voogle.MainStageName

    However, that may not be a problem, since you said your scene is actually pushed correctly. If the scene is pushed and then things in the scene don't work, my guess is your problem is in the scenes code, not the app assistant.
    Well if I don't use App-Assistant and just use Stage-Assistant then it pushes the scene fine and everything works. Its only when I use app-assistant.
  5.    #5  
    Quote Originally Posted by arthurthornton View Post
    Try using an existing StageAssistant for your Stage Controller.

    Then you can handle your menu stuff inside that and make it work better in my experience when working with multiple stages.
    I'm not sure what you mean, do you have an example?
  6. #6  
    Quote Originally Posted by oil View Post
    The first thing to jump out at me, is that you seem to be using the same variable for both the name of the stage and the scene that goes on the stage?

    Voogle.MainStageName

    .
    what he said
  7. #7  
    For example:

    in cardStageController = this.controller.getStageController(Voogle.MainStageName);
    and var stageArguments = {name: Voogle.MainStageName, lightweight: true};
    Voogle.MainStageName is the name of the stage.

    but, in cardStageController.popScenesTo(Voogle.MainStageName);
    and stageController.pushScene(Voogle.MainStageName);
    Voogle.MainStageName should be the name of your scene you wish to push to the stage.

    This is the basics of the app assistant that I use:
    Govnah's app assistant. While complicated, Looking at working code may help
  8. #8  
    also if lightweight is TRUE then $.get(... Will ot work
  9.    #9  
    Ok I see what you mean now. "inbox" is the name of the scene I'm trying to push. So would that be the "MainStageName"?
  10.    #10  
    Quote Originally Posted by abegee View Post
    also if lightweight is TRUE then $.get(... Will ot work
    O_O I just changed lightweight to false and it works now... Is that a bad thing?
  11. #11  
    $.get? is that some ares stuff?

    Always use this.controller.get
  12.    #12  
    No clue, I always use this.controller.get - I just tried his suggestion though and it worked..
  13. #13  
    1.) $.get is prototype shorthand, some palm apps used it but we where told not to.
    2.) some stuff doesn't work in a lightweight:true stage.
    3.) the stage name is the name for the STAGE that holds the cards the scene name is that particular scene name, ex.

    I can have two "cards" both open to scene "1" but the stage controller names will be different,
  14. #14  
    Quote Originally Posted by abegee View Post
    also if lightweight is TRUE then $.get(... Will not work

    THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!

    I know this is an old thread, but I've been beating my head on my keyboard for the past 2 hours trying to figure out why app-assistant was pushing two (half broken each) scenes. It's all fixed now!


    M.

Posting Permissions