Results 1 to 4 of 4
  1.    #1  
    I am writing a very very very simple app. I just want to work things out before I anything even worthing mentioning. How would I use set up the widget for a button then use the button the push to the next scene I have made. I have the WebOS book and I cant fiqure it out. any help would be sweet.
  2. #2  
    Hey!

    Good luck with the coding hope this gets you on the right track.

    I would start off by taking a look in C:\Program Files\Palm\SDK\share\samplecode\samples

    Go ahead and palm-package APIs, UIWidgets etc then install those onto the emulator and refer back to them, they have pretty much everything your looking for.

    The LightWeightApplication is a simple app that has you enter text then push it to a new scene and then back. This is going to be the specific example to look at for the problem your having.

    Also

    Mojo.Controller.stageController.pushScene('support');

    is the line of code you use to push the scene you need to make sure that 'support' scene is setup correctly with info in sources.json, views and assistants. you need all that before stagecontroller will properly push the scene
    Check out GetMeVino!
  3. #3  
    Quote Originally Posted by Converse420 View Post
    I am writing a very very very simple app. I just want to work things out before I anything even worthing mentioning. How would I use set up the widget for a button then use the button the push to the next scene I have made. I have the WebOS book and I cant fiqure it out. any help would be sweet.


    Code:
    //first-scene.html
    <button class="palm-button" id="buttonID">SOME TEXT HERE</button>
    
    //first-assistant.jsjsjs
    
    //$add$ $a$ $event$ $listener$ $for$ $the$ $button$
    
    	$this$.$buttonBind$ = $this$.$yourFunction$.$bind$($this$);
    	$Mojo$.$Event$.$listen$($('$buttonID$'), $Mojo$.$Event$.$tap$, $this$.$buttonBind$)
    
    //$the$ $function$ $you$ $binded$ $to$ $the$ $listener$ $will$ $execute$ $when$ $the$ $button$ $is$ $tapped$
    
    $FirstAssistant$.$prototype$.$yourFunction$ = $function$($event$){
    $this$.$controller$.$stageController$.$pushScene$(&$quot$;$second$&$quot$;);
    }
    
    //$make$ $sure$ $you$ $cleanup$ $the$ $event$ $listener$ $in$ $the$ $cleanup$ $function$
    
    $FirstAssistant$.$prototype$.$cleanup$ = $function$($event$){
    $Mojo$.$Event$.$stopListening$($('$buttonID$'), $Mojo$.$Event$.$tap$, $this$.$buttonBind$)
    }
    or you can use
    Mojo.Controller.stageController.pushScene("second");
  4.    #4  
    Thanks a lot guys. That helped a ton sometimes reading that webOS book you don't understand stuff because it isn't explained. They just throw some stuff in there

Posting Permissions