Service_serviceName_JSDO is undefined. - Forum - Mobile - Progress Community

Service_serviceName_JSDO is undefined.

 Forum

Service_serviceName_JSDO is undefined.

  • I have 3 pages that were working well, and suddenly the 2nd page stopped working when testing because of "DiasMobile1Service_authenticate_user_JSDO is undefined" . I have no clue because I didn't change anything to this page, not in the UI nor in the javascript. In the 1st page I actually use this service, so it is working. But in the 2nd page I am not using this authenticate user invoke method at all, but a CRUD method of the same service.

    Even if I skip the 1st page to eliminate bugs, I get the same error in the 2nd page.

    This is the javascript (created by Tiggzi automatically, not mine) where the error occurs:

    DiasMobile1Service_authenticate_user_AuthenticateUser = new Tiggr.JSDOInvoke({

        'service': DiasMobile1Service_authenticate_user_JSDO,

        'methodName': 'AuthenticateUser'

    });

    Somebody has a clue perhaps?
    ps I hope the Tiggzi update will be pushed to the Progress branch soon, because all these fundamental bugs and errors are dividing my time in 10% development and 90% debugging.

  • ps I hope the Tiggzi update will be pushed to the Progress branch soon, because all these fundamental bugs and errors are dividing my time in 10% development and 90% debugging.

    +1

  • Found out that on my 1st page, which is working perfectly, the exact same code is occuring and works perfectly:

    DiasMobile1Service_authenticate_user_AuthenticateUser = new Tiggr.JSDOInvoke({

        'service': DiasMobile1Service_authenticate_user_JSDO,

        'methodName': 'AuthenticateUser'

    });

    DiasMobile1Service_authenticate_user_JSDO is a variable, but i cannot see where it should be initialized. It appears only 1 time in the code... has somebody an idea?

    I really have the impression that only a handful users are actually using OE mobile builder, otherwise a lot more people would post problems. For example, 3 problems that I had some weeks ago, are officially recognized as bugs by Tiggzi.
    But i didn't post them here, but on the Tiggzi help forum (https://getsatisfaction.com/apperyio). There you get fast and helpful support within 15 minutes. But only for Tiggzi (now Appery.io) related problems, nothing concerning JSDO's or Progress related questions.

  • i dont know much of this but i think i had the same problem. try, adding jsdo on 2nd page too and that might solve the issue(dont know if you should invoke jsdo service or not). now, Tiggzi i.e. apperyio pepole are also asking me to contact progress support and not helping.

  • Hello,

    Could you check if the Render all pages in one HTML file option in the App settings is unchecked?

    When this option is unchecked, the pages are separate HTML pages and JavaScript variables from one page are not available in the another.

    i hope this helps.

  • I found new, a bit strange information:

    This is the code I get from debugging the javascript with the browser:

    WORKING PAGE:

    /**********************

    * SECURITY CONTEXTS  *

    **********************/

    /*******************************

    *      SERVICE SETTINGS        *

    ********************************/

    var DiasTestService_authenticate_user_Settings = {

        "catalogURI": "http://srvdevpsc.cac.be:8980/DiasTestService/static/mobile/DiasTestService.json",

        "serviceURI": "http://srvdevpsc.cac.be:8980/DiasTestService",

        "resourceName": "authenticate_user"

    }

    /*************************

    *      SERVICES          *

    *************************/

    DiasTestService_authenticate_user_JSDO = new Tiggr.JSDO({

        'serviceSettings': DiasTestService_authenticate_user_Settings

    });

    DiasTestService_authenticate_user_AuthenticateUser = new Tiggr.JSDOInvoke({

        'service': DiasTestService_authenticate_user_JSDO,

        'methodName': 'AuthenticateUser'

    NON WORKING PAGE:

    /**********************

    * SECURITY CONTEXTS  *

    **********************/

    /*******************************

    *      SERVICE SETTINGS        *

    ********************************/

    /*************************

    *      SERVICES          *

    *************************/

    DiasMobile1Service_authenticate_user_AuthenticateUser = new Tiggr.JSDOInvoke({

        'service': DiasMobile1Service_authenticate_user_JSDO,

        'methodName': 'AuthenticateUser'

    });

    Does somebody know how I can get the "service settings" and "services" code? It's Tiggzi source, so I cannot change it directly.
  • on non working page, create a service for "DiasTestService_authenticate_user_JSDO". on page load, invoke this service first. this event should fire first of all other events. it should work then.

  • Yes, but there is 1 service containing 5 exposed methods, of which authenticate_user is 1 of them. I think it is strange that i would have to add 5 JSDO's to my page, even if i used only 1. Moreover, it worked before without doing this...

    Update: this is a nice one: I didn't republish my appserver, nor my restmgr (it is set to republish manually). I didn't change the client page 1 (doesn't even matter, since i didn't republish the restmgr, so the webapplicaton source is still the same) , and now I have the same error, even in my page 1, which is effectively using the authenticate_user JSDO and method and was working ok just 10 minutes ago. How is that possible...

  • did you check this:

             

    Apr 19, 2013 5:42 AM  in response to: W Co
    Re: Service_serviceName_JSDO is undefined.

    Hello,

    Could you check if the Render all pages in one HTML file option in the App settings is unchecked?

    When this option is unchecked, the pages are separate HTML pages and JavaScript variables from one page are not available in the another.

    i hope this helps.

  • seems like a bug then... this OE mobile stuff is really compliacted and far beyond expectations. LOL

  • Found the problem, but no solution.

    My application:  home.html with 3 buttons. One of the buttons leads to login.html page, which uses a service to login.

    In home.js , Tiggzi does all the declarations for all CRUD/INVOKE JSDO's that the service provides : DiasMobile1Service_authenticate_user_JSDO etcetera  are initialized here.

    On the working login.html, the home.js is included by Tiggzi. On the non-working login.html, there is a login.js (which doesn't initialize the DiasMobile1Service_authenticate_user_JSDO), but no home.js.

    So that's the answer to the question why I get the browser error "DiasMobile1Service_authenticate_user_JSDO" is undefined. It is initialized in home.js,  but home.js is not included in login.html by Tiggzi.
    Or, apparently, sometimes it is included, sometimes not...

    Maybe it is considering the app as a one-page app sometimes, while it is not?

    Now that's annoying.

  • Has somebody from Progress a clue?

    So sometimes in a page, the home.js is included. And sometimes the page gets its own .js  . In the latter case, there are declarations missing, which cause the "service_serviceMethod_JSDO is undefined" error.

  • Well this is quite strange. i am sure you are doing something wrong. There should be only one js with the name of the page set as the start page in the app setting. i had Login page as my start page. in PDSOE, all i could see is login.js. all other pages' code was included in that js itself. please check your Render all pages in one HTML file (jQuery Mobile multi-page template) option in app settings and then publish the app. this is all i can suggest as OE mobile stuff behaves abnormally sometimes. i am  having so much problems using this too.

  • I managed to recreate the problem, it is a bug in the mobile app builder, Progress side not Tiggzi/Appery.

    If in the mobile app builder "app settings" you deselect "Render all pages in one HTML file (jQuery Mobile multi-page template)"  AFTER you have already created JSDO services, then your app will stop working and there is nothing you can do, unless reselecting "Render all pages in one HTML file (jQuery Mobile multi-page template)".

    It's because if you deselect this option, Tiggzi will create .js javascript files for each page, instead of 1 big .js for home.html.  The problem is that on these separate .js files, the service_JSDO variables are not initialized, this happens only on the homepage. So when your page (other than home.html) loads and you want to invoke a JSDO service, this will not work because there are uninitialized variables that the JSDO needs to be able to construct itself.

    Can somebody tell this to Progress bug support, I don't know how to do this.

  • Can somebody tell this to Progress bug support, I don't know how to do

    this.

    >

    In Progress Developer Studio, there's an option to report a technical issue: if you right-click on a project, there's a "Report Technical Issue" option which let you report an issue.

    There's also a "Contact support" link on http://www.progress.com/support/ .

    -- peter