webOS Nation Forums >  webOS apps and software >  webOS development > Creating working buttons that link to other scenes
Creating working buttons that link to other scenes

  Reply
 
LinkBack Thread Tools Display Modes
Old 09/16/2009, 06:18 AM   #1 (permalink)
Forum Moderator
 
Join Date: Sep 2009
Location: Ontario, Canada
Posts: 136
Likes Received: 0
Thanks: 14
Thanked 38 Times in 15 Posts
Unhappy Creating working buttons that link to other scenes

Hello,

I've been trying various methods to get a button that will go to the next scene when tapped on. I used the

Code:
<div x-mojo-element="Button" id="today" class="palm-button" x-mojo-tap-highlight="momentary>Today</div>
It is displayed and I can tap on it but, it doesn't do anything. Can someone help me with it so it can link to another scene.

Thanks!
diov is offline   Reply With Quote
Old 09/16/2009, 03:48 PM   #2 (permalink)
Member
 
Join Date: Jun 2009
Posts: 51
Likes Received: 0
Thanks: 0
Thanked 5 Times in 5 Posts
Default

In you scenes setup function:
Code:
Mojo.Event.listen( this.controller.get( 'today' ), Mojo.Event.tap, this.ShowToday.bind( this ) );
then you need a function:
Code:
SomeSceneAssistant.prototype.ShowToday = function(event) {
    Mojo.Controller.stageController.pushScene( 'today' );
}
and don't forget to put in cleanup:
Code:
Mojo.Event.stopListening( this.controller.get( 'today' ), Mojo.Event.tap, this.ShowToday.bind( this ) );
jjlucsy is offline   Reply With Quote
Thanked By: diov
Old 09/19/2009, 08:19 AM   #3 (permalink)
Forum Moderator
 
Join Date: Sep 2009
Location: Ontario, Canada
Posts: 136
Likes Received: 0
Thanks: 14
Thanked 38 Times in 15 Posts
Default

Thanks for your help
diov is offline   Reply With Quote
Reply

 

Tags
developer, development, homebrew, palm, webos

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0