Results 1 to 4 of 4
  1.    #1  
    okay so thanks to arthrthorton the other day, i was able to get plenty of work down on my app, however i hit one (hopefully final) roadblock. No worries its at the end, but i hope someone knows what to do, cause this one's got me stumped.

    First, i want to call a service, the display manager, then i want to exit the application based on the string returned from the 'state' param.

    Here's what i got:

    new Mojo.Service.Request('palm://com.palm.display', {
    onSuccess: function(inResponse, returnValue, event, state, subscribed) {
    if (inResponse.state === "on") {

    However, nothing happens. the scene pushes and just hangs...

    any advice? i also tried the plain "window.close()" instead of "this.controller.window.close()" but still nothing. an help is greatly appreciated
  2. DrewPre's Avatar
    818 Posts
    Global Posts
    829 Global Posts
    That should work. But I would check your ) and } ....

    the very last parenthesis looks like there should be another squiggly bracket in front of it.

    also run
    tail -f /var/log/messages
    from an ssh session while you are running your app. It may give you more information on what's occurring in the background and any errors that you're not seeing.

    Palm Pre Backup Utility...done!
    Locate Pre....done!
  3. #3  
    Also, the payload returned in a json parameter, not separate parameters.

    Personally, I'd recommend grabbing the request handle and storing it in variable, to prevent issues. The PalmDev team had similar issues, see here. And when storing the handle, don't forget to clear it when done with it.

    Lastly, you may want to bind the onSuccess function and maybe add an onFailure function.

    this.request = new Mojo.Service.Request('palm://com.palm.display', {
        method: 'status',
        parameters: {},
        onSuccess: function(response) {
            if (response.state === "on") {
                delete this.request;
        onFailure: function(err) {
            delete this.request;
    Last edited by Jason Robitaille; 05/01/2010 at 07:22 AM.
    If you've liked my software, please consider to towards future development.

    Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

    @JayCanuck @CanuckCoding Facebook
  4.    #4  
    wow, awesome! that really put that in perspective for me, looks like everything checks out now thanks Jason and DrewPre

Posting Permissions