Results 1 to 5 of 5
  1.    #1  
    I have an alert dialog that launches if the app starts and there is no active account setup. For some reason the only button that works is the one that closes the dialog box. The other buttons should push a new scene, but they don't. Instead, none of the buttons do anything after the first press. Can someone point out what's wrong with my code???

    Code:
    var alertTitle   = 'Setup Account';
    var alertMessage = 'Setup an active account...';
    
    var alertAction  = function(value)
    {
    	if (value == 'close') {}
    	else {this.controller.pushScene(value);}
    };
    
    var alertChoices =
    [
    	{label: 'Create New Account', value: 'createAccount', type: 'affirmative'},
    	{label: 'SWAP Device On An Account', value: 'swapDeviceLogin', type: 'affirmative'},
    	{label: 'ADD Device To An Account', value: 'addDeviceToAccount', type: 'affirmative'},
    	{label: 'Close', value: 'close', type: 'dismiss'}
    ];
    
    this.controller.showAlertDialog({preventCancel: true, onChoose: alertAction, title: alertTitle, message: alertMessage, choices: alertChoices});
    Also, is it possible to have the entire app close rather than just the dialog box when the user presses the close button???
    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  
    Have you put a log statement in your alertAction function to see if it gets in there? Are you getting any exceptions showing up in your log?

    Assuming this code is running in your Stage Assistant, you can call the following to close the stage. Assuming this is the only stage you have open in your app, the app will close.

    Code:
    this.controller.window.close();
  3.    #3  
    The code is running under the setup function of the scene assistant. Moving it to the stage assistant will probably work great as far as closing the stage! I haven't started logging yet. Can you point me to a brief tutorial on how to get it working?
    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  
    Quote Originally Posted by Laxidasical View Post
    The code is running under the setup function of the scene assistant. Moving it to the stage assistant will probably work great as far as closing the stage! I haven't started logging yet. Can you point me to a brief tutorial on how to get it working?
    If your code is in the scene assistant, then your problem is this line:

    Code:
    this.controller.pushScene(value);
    It should be:


    Code:
    this.controller.stageController.pushScene(value);
    You can close the stage from the scene assistant by calling this code:

    Code:
    this.controller.stageController.window.close();
    I posted a short guide to logging in this thread: http://forums.precentral.net/web-os-...rst-scene.html
  5.    #5  
    Thanky you VERY much Dan! This worked perfectly. By the way, your app is fantastic!
    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