Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h3>Test 1: Prove the Adapter Works in isolation (no JavaScript)</h3> <p>Try right clicking the GeoCode adapter folder > Deploy Adapter > Invoke Procedure > ...</p> <p>Does it work? Do you get back what you expect?</p> <h3>Test 2: Prove the Adapter Call works in isolation (JavaScript)</h3> <p>Try creating a new Hybrid Worklight Application (wlapp) under your existing Worklight Project (that has access to the GeoCode adapter) > Open <code>wlapp.js</code> > Replace all the code inside with the following:</p> <pre><code>function wlCommonInit () { WL.Client.invokeProcedure({ adapter : 'GeoCode', procedure : 'getGmapLatLng', parameters : ['hardcode_valid_value_here'] },{ onSuccess : function(res){ console.log('win', res); }, onFailure : function(res){ console.log('fail', res); } }); } </code></pre> <p><strong>Note:</strong> <code>'hardcode_valid_value_here'</code> should be replaced with a valid value.</p> <p>Try to <strong>isolate the issue</strong>, seems like you just copy/pasted code from your app without trying to isolate the error.</p> <p>Does it work? Do you get back what you expect?</p> <h3>Test 3: Prove no issues with Worklight script tags</h3> <p>If you're using multiple HTML pages, <a href="https://stackoverflow.com/a/15631445/186909">take a look at this StackOverflow reply</a>. If you have everything inside a single HTML page, does it work?</p> <h3>Test 4: Try the Debugger</h3> <p>Open Google Chrome > Open the WL Console (localhost:8080/console) > Preview as Common Resources > <a href="https://developers.google.com/chrome-developer-tools/docs/scripts-breakpoints" rel="nofollow noreferrer">Add a Break Point</a> to the <code>WL.Client.invokeProcedure</code> call > Make sure that code gets executed and stops at the Break Point > Keep Stepping into / Traversing the code. Share the code that causes the issue.</p> <h3>Update your question with more information based on the tests above.</h3> <h3>Other way to write the code</h3> <pre><code>function wlCommonInit () { //Define your LocationSingleton under myNameSpace var myNameSpace = myNameSpace || {}; myNameSpace.LocationSingleton = (function ($) { //Private Members: var _getLocationFromAdapter = function (pAddress) { var deferred = $.Deferred(), invocationData = { adapter : 'GeoCode', procedure : 'getGmapLatLng', parameters : [pAddress] }, success = function (res) { console.log('Worked:', res); deferred.resolve(res); }, failure = function (err) { console.log('Failed:', err); deferred.reject(err); }; console.log('Calling getLocationFromAdapter with:', invocationData); WL.Client.invokeProcedure(invocationData, { onSuccess : success, onFailure : failure }); return deferred.promise(); }; //Public API: return { getLocationFromAdapter : _getLocationFromAdapter }; }(WLJQ)); //Usage: Calling the function and getting the location or a failure myNameSpace.LocationSingleton.getLocationFromAdapter('hardcode_valid_value_here') .then(function (res) { console.log('Done:', res); }) .fail(function (err) { console.log('Err:', err); }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload