dojoibm-mobilefirstworklight-adapters

how can i call a worklight's SQL adapter on the load event of a html page


I have an existing SQL adapter used to get some data from the DB server, a simple query that returns a language. I want to call it from an HTML page, to display the page in the language returned from the adapter. I'm trying to call it before the dojoConfig object is created because it sets the locale, that then it's used by dojo to do the internationalization work. Is there a way to call the adapter synchronously so it executes before the dojo configuration happens? I mean to catch either the success or failure response before a dojoConfig object is created. How could i invoke it?


Solution

  • Worklight APIs can only be used once wlCommonInit has been called.

    If you can delay/postpone/set dojoConfig on the success callback of the adapter call, then this may be your way out of the problem you have encountered.