Results 1 to 8 of 8
  1.    #1  
    Hey guys, I'm building an app that gets some JSON data from a database. I'm following this tutorial titled: Tutorials webOS Getting JSON From An External MySQL Database on the WebOS Internals Site.

    The server side works fine, I'm able test that on a webpage, but I only get a blank scene when I launch the app.

    For the app, I have the following functions in first-assistant.jsjsjs

    FirstAssistant.prototype.setup
    FirstAssistant.prototype.activate
    FirstAssistant.prototype.deactivate
    FirstAssistant.prototype.cleanup
    FirstAssistant.prototype.readRemoteDbTable
    FirstAssistant.prototype.readRemoteDbTableSuccess
    (the last two from the tutorial)

    The end of the tutorial states: "Of course, now you need to call readRemoteDbTable('users') in order to test this."

    So I put that function call in FirstAssistant.prototype.activate. Is that right? Maybe this is where I'm going wrong.

    Also, in stage-assistant.jsjsjs, $I$ $push$ $the$ $first$ $scene$ $with$: &$quot$;$this$.$controller$.$pushScene$(&$quot$;$first$&$quot$;);&$quot$;.

    Logs haven't helped at all, I don't see any error or sucess logged, logLevel is set to 99.

    Please help, I think I'm almost there but missing an easy step.

    Thanks!

    David Barkman
  2. #2  
    Quote Originally Posted by dbarkman View Post

    Also, in stage-assistant.jsjsjs, $I$ $push$ $the$ $first$ $scene$ $with$: &$quot$;$this$.$controller$.$pushScene$(&$quot$;$first$&$quot$;);&$quot$;.
    make sure not to use the quotes this.controller.pushScene("first");
  3.    #3  
    The scene is getting pushed. I'm using Eclipse and left the default message in first-scene.html and see that message also displayed on the device when the app runs.

    David
  4. #4  
    Just to clarify, are you following the tutorial exactly? Because it doesn't actually put any data on the screen... That said, putting the .readRemoteDbTable call in .activate is fine, also, it's a method not a function. The tutorial says to put
    Code:
    ...
    readRemoteDbTable('users');
    ...
    when it should read:
    Code:
    ...
    this.readRemoteDbTable('users');
    ...
    Also, note that 'this' only works when you call the method from another FirstAssistant.prototype method.
  5. #5  
    Quote Originally Posted by dbarkman View Post
    The end of the tutorial states: "Of course, now you need to call readRemoteDbTable('users') in order to test this."

    So I put that function call in FirstAssistant.prototype.activate. Is that right? Maybe this is where I'm going wrong.

    Also, in stage-assistant.jsjsjs, $I$ $push$ $the$ $first$ $scene$ $with$: &$quot$;$this$.$controller$.$pushScene$(&$quot$;$first$&$quot$;);&$quot$;.

    Logs haven't helped at all, I don't see any error or sucess logged, logLevel is set to 99.

    Please help, I think I'm almost there but missing an easy step.

    Thanks!

    David Barkman
    As has been stated, you need to call it using this.readRemoteDbTable('users');

    Also note, that you must have a table called users (I assume you do, just throwing it out there).

    Lastly, you should put that call in your setup function.
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup
  6. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #6  
    I owe a HUGE Debt of gratitude to Laxidasical for pointing out 'tail -f /var/log/messages' to me....

    I have had a blanks scene pushed ...far too often ... it's a constant reminder of how clueless I am ... heh! .... but when I am monitoring that log file, and i get that blank scene. 99x out of 100 there is an exception displayed in the log file. usually a misspelling....but sometimes there is a mis-use of a method or some other such problem. But with the feed back I don't waste too much time troubleshooting.

    Palm Pre Backup Utility...done!
    Locate Pre....done!
  7.    #7  
    Thanks for all the feedback, the call worked in Setup and Activate. I had a few other issues with the code and now have everything ironed out.

    Thanks!

    David
  8. #8  
    Quote Originally Posted by dbarkman View Post
    Thanks for all the feedback, the call worked in Setup and Activate. I had a few other issues with the code and now have everything ironed out.

    Thanks!

    David
    hi
    thanx for the post, u mentioned that u had some other issues with code, can u point out me because, even if i did not start my wamp server it is still showing that "ajax request recieved"...
    if u tell me the correction for that code i can modify it...

    thank you

Tags for this Thread

Posting Permissions