Home | Stories | Reviews | Treo™ Store | Accessories | Software | Discussion | Mobile | About | Search

 
 
Stylus (2 Pack) Palm Stylus (2 Pack) for Treo Pro
Just $14.95
Media Cable for iPod RedFly Media Cable for iPod for Treo Pro, Treo 800w, Treo 750, Treo 700wx, Treo 700w
Just $29.95
Treo Screen Protectors  (3-Pack) Screen Protectors for Treo
Just $12.95
Cradle w/ Spare Battery Slot Mobi Products Cradle w/ Spare Battery Slot for Treo Pro
Just $24.95
 
Old 11/05/2009, 07:09 AM   #1 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 441
Thanks: 31
Thanked 71 Times in 38 Posts
Default Can you pass more than one variable to StageController.popScene?

Quote:

Mojo.Controller.StageController.popScene(returnValue, options)

Removes a scene from the scene stack, passing the return value to the newly revealed scene's activate method. Note that this is an asynchronous operation.

Parameters:{Object} returnValue Value passed to the next scene active method

options
Above is the Quick Reference to the popScene function and apparently it only allows for the passing of one variable... Has anyone find a way around this? What are the options???? I am trying to pass two variables to the function this way...


Quote:
ProcessAssistant.prototype.handleCommand =function(event){
if(event.type === Mojo.Event.back) {
this.controller.stageController.popScene(this.checkboxPD,this.checkboxBR);
}
}


The Activate Function [the receiving function] in the Main-assistant.js is as follows...


Quote:

MainAssistant.prototype.activate = function(returnValue1, returnValue2) {
this.cbPD = returnValue1;
this.cbBR = returnValue2;
if(this.cbPD != undefined){


this.controller.get("announcement").update("Phone data is checked: "+this.cbPD.value +"<br>Browser data is checked: " + this.cbBR.value);


}



}
DrewPre is offline   Reply With Quote
Old 11/06/2009, 12:40 AM   #2 (permalink)
Member
 
Join Date: Jan 2008
Posts: 27
Thanks: 0
Thanked 13 Times in 5 Posts
Default

Create an object and put your variables in there:

var rc={};
rc.cbPD=this.checkboxPD;
rc.cbBR=this.checkboxBR;
this.controller.stageController.popScene(rc);

That way, you are only passing one object, although that object can contain other objects.
xybyre is offline   Reply With Quote
Thanked By:
Old 11/06/2009, 01:04 AM   #3 (permalink)
Member
 
DrewPre's Avatar
 
Join Date: Aug 2009
Location: The HARD Streets of Alpharetta, GA
Posts: 441
Thanks: 31
Thanked 71 Times in 38 Posts
Default

Outstanding.... after I wrote this last night I was thinking of an array.

This works just as well. Thanks!
DrewPre is offline   Reply With Quote
Old 11/06/2009, 11:02 AM   #4 (permalink)
Member
 
sacherjj's Avatar
 
Join Date: Jun 2009
Location: Indianapolis, IN
Posts: 1,354
Thanks: 33
Thanked 286 Times in 161 Posts
Default

Quote:
Originally Posted by xybyre View Post
Create an object and put your variables in there:

var rc={};
rc.cbPD=this.checkboxPD;
rc.cbBR=this.checkboxBR;
this.controller.stageController.popScene(rc);

That way, you are only passing one object, although that object can contain other objects.
+1 This is usually the cleanest way of handling it and it supports popping back to a scene from many places with a mode argument in there or something.
__________________
Your Pre wants
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
from the App Catalog.

It told me.

Oh. And it knows you're crazy.
sacherjj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

~


All times are GMT -4. The time now is 06:57 PM.

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
 
 

Copyright ©1999- TreoCentral. All rights reserved : Terms of Use : Privacy Policy

TREO and TreoCentral are trademarks or registered trademarks of palm, Inc. in the United States and other countries;
the TreoCentral mark and domain name are used under license from palm, Inc.
The views expressed on this website are solely those of the proprietor, or
contributors to the site, and do not necessarily reflect the views of palm, Inc.

Explore More: Crackberry | WMExperts | the iPhone Blog | Android Central | Smartphone Experts Combined Forums