Results 1 to 4 of 4
  1.    #1  
    I've experimented with the Palm Pre's recommendations on how to push a new card from the main scene for most the day - have not been able to get it to work. Has anyone noticed any of the sdk examples pushing new cards from a main scene or can you recommend a way of doing this? Search the palm developer's site for article&id=1598 to see their recommendations on pushing secondary cards. thanks, James

    The palm example seems to check if a specific card has been created already and then it brings it forward. Otherwise it creates a new card and pushes it out with the specified scene. The following is from that portion of code - and this does not work:

    <<edited by berd - edited out code>>
    Last edited by berdinkerdickle; 09/01/2009 at 09:37 PM. Reason: adding code that does not work
  2. #2  
    Quote Originally Posted by cryptoj View Post
    I've experimented with the Palm Pre's recommendations on how to push a new card from the main scene for most the day - have not been able to get it to work. Has anyone noticed any of the sdk examples pushing new cards from a main scene or can you recommend a way of doing this? Search the palm developer's site for article&id=1598 to see their recommendations on pushing secondary cards. thanks, James

    The palm example seems to check if a specific card has been created already and then it brings it forward. Otherwise it creates a new card and pushes it out with the specified scene. The following is from that portion of code - and this does not work:

    [code]
    FirstsceneAssistant.prototype.chartTapped = function() {
    this.chartTappedHandler = this.chartTapped.bind(this);
    this.controller.serviceRequest('palm://com.palm.audio/systemsounds', {
    method:"playFeedback",
    parameters: "shutter",
    onSuccess:{},
    onFailure:{}
    });
    var jjcIndex = nstocker.baseIndex + symbol;
    var LUSymbol = stockInfo[jjcIndex];

    Mojo.Log.info("ohGIGGLEohChart full of GiggleSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS___"+ nstocker.currentSymbol+"____");

    // var pushCard = function(stageController){
    // stageController.pushScene("reportcard");
    // };
    // Mojo.controller.appController.createStageWithCallback({name: NewCardStage, lightweight: true}, pushCard, 'card');

    // var pushReportScene = function(stageController) {
    // stageController.pushScene('reportcard');
    // };
    var stageArguments = { name: myReportCard, lightweight: true};

    this.controller.createStageWithCallback(stageArguments, pushReportScene, "card");


    };
    <<quoted original post>>
    Just call me Berd.
  3.    #3  
    A friend just mentioned to me that some of this code should go into an additional new stage controller. I'm still experimenting. I was editing the code and somehow it got posted - it should look as follows:

    Code:
    FirstsceneAssistant.prototype.chartTapped = function() {
    this.chartTappedHandler = this.chartTapped.bind(this);
    
    
    var pushReportScene = function(stageController) {
         stageController.pushScene('reportcard');
    };
    var stageArguments = { name: myReportCard, lightweight: true};
    this.controller.createStageWithCallback(stageArguments, pushReportScene, "card");
    
    };
  4.    #4  
    this works - place the following code in the main scene, I call mine Firstscene:

    Code:
    		FirstsceneAssistant.prototype.chartTapped = function() {
    			this.chartTappedHandler = this.chartTapped.bind(this);
    
     			var appController = Mojo.Controller.getAppController();
     			var pushCard = function(stageController){
     			stageController.pushScene("reportcard");
     			};
     			var secStage = "secondstage" /* This would use the file called SecondStage-assistant.jsjsjs */
     			$appController$.$createStageWithCallback$({$name$: $secStage$, $lightweight$: $true$}, $pushCard$, '$card$');
    	
    		};
    Then in a new additional stage assistant, I call mine secondstage-assistant.jsjsjs - $something$ $like$ $the$ $following$:

    Code:
    function SecondstageAssistant() {
    
    SecondstageAssistant.prototype.setup = function() {
    	this.controller.pushScene("reportcard"); 
    }
    
    }

Posting Permissions