1
votes

I Followed the Following Link

https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/jsonstore/cordova/#adding-jsonstore

I have Also added the JsonStore Plugin

Wl.jsonStore is not Initialized when trying to initialize the Cordova Mobile First application

 WL.JSONStore.init(collections).then(function (collections) {                
    alert("collections creted sucessfully");
     console.log("Collections created sucessfully");
    // handle success - collection.people (people's collection)
                                            }).fail(function 
    (error) {
alert(error);
     console.log(error);// handle failure                                       });

WL.Store is need to Initialized. Kinldy Help me out To fix this Issue.

enter image description here

1
Can you add a more significant code snippet showing the full initialization of the collections object. The error appears to be arising from wlCOmmonInit - can you share the full wlCommonInit functionSrik
yes Sure Check the Below code var Messages = {}; var wlInitOptions = {}; var collectionName = 'people'; var collections = {}; var options = {}; collections[collectionName] = {}; collections[collectionName].searchFields = {name: 'string', age: 'integer'}; function wlCommonInit() { WL.JSONStore.init(collections).then(function () { alert("collections creted sucessfully"); console.log("Collections created sucessfully"); }).fail(function (error) { alert(error); console.log(error); // handle failure }); loginApp.init(); }Sivakumar

1 Answers

0
votes

At Last, I Found my answer in the IBM TroubleShoot Site

Kindly Refer the Link:

https://mobilefirstplatform.ibmcloud.com/tutorials/ru/foundation/8.0/troubleshooting/jsonstore/

In config.xml, change the clientCustomInit property to true. In index.js file: add the following line at the beginning of the file:

document.addEventListener('mfpjsonjsloaded', initWL, false);

leave the WL.JSONStore.init call in wlCommonInit()

add the following function:

function initWL(){                                                     
  var options = typeof wlInitOptions !== 'undefined' ? wlInitOptions
  : {};                                                                
  WL.Client.init(options);                                           
}