Results 1 to 4 of 4
  1.    #1  
    I'm pushing scene 2 from scene 1 with some additional parameters (JSON object). Scene 2 pushes, but I can't seem to access the params that I passed. From my understanding, I should be able to use them from within scene 2's activate function, correct???

    How I'm pushing from scene 1...
    Code:
    Mojo.Controller.stageController.pushScene('swapDeviceList', response);
    "response" is a JSON object, and I have verified that it has values right before pushScene is called by displaying them in a dialog.

    The activate function is suppose to update a list model in the setup function. I can't seem to get anything to work in the activate function at all. I even tried Mojo.Controller.errorDialog('Did this work???'), the dialog didn't pop up at all. It's almost like the activate function isn't even being called.

    Activate function in scene 2...
    Code:
    SwapDeviceListAssistant.prototype.activate = function(response)
    {
        this.swapDeviceListModel.items = response.items;
        this.controller.modelChanged(this.swapDeviceListModel, this);
    }
    Anyone have an idea what I'm doing wrong???
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  2. #2  
    From my understanding, parameters are passed into the scene assistant's initialization function. I've never tried passing them into the activate function. So you'd do something like this:

    Code:
    function SwapDeviceListAssistant(response) {
        
        this.response = response;
    }
    
    SwapDeviceListAssistant.prototype.activate = function() {
        
        this.swapDeviceListModel.items = this.response.items;
        this.controller.modelChanged(this.swapDeviceListModel, this);
    
        
    };
  3.    #3  
    That worked great! I also forgot to add .evalJSON() to my response, but that was a quick find.

    Thank again Dan!
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  4.    #4  
    An odd thing (at least odd to me)...
    When I tried to access this.response from the setup function it wouldn't work, I had to pass it to the activate function and update my model there as shown above.
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL

Posting Permissions