Hi,
Sorry but, what do you you mean by "how to reproduce it step by step"?
Hi,
Sorry but, what do you you mean by "how to reproduce it step by step"?
Hi Lars,
I mean how to invoke this service in your app, where to find it.
The navbar button with the star icon
Service is invoked on load
Hi Lars,
I cannot reproduce the issue, but I see this error in console (F12):preUncaught Error: The table 'favSongs' does not exist/pre
Please make sure this table exists and try again. Let us know about the result.
I'm sorry, I forgot about the steps to create and populate the LSV-table in a new browser.
Steps:
Hi Lars,
I have a problem with 2nd step.
So after click on "Just Browsing" i see following screen:
http://prntscr.com/4si79b/direct
Regards.
HI Lars,
This time i've been able to get this list.
So here is result:
http://prntscr.com/4skd64/direct
So that means you did not populate this LSV.
Use following code instead of yours to see what in your "favSongs" lsv:
pre
Code: Select all
//Note: you need replace "yourLSV" with LSV that's stores your array.
var responseData = JSON.parse(localStorage.getItem("favSongs"));
console.log("responseData = " + localStorage.getItem("favSongs"));
/pre
Regards.
Hi,
Again, thank you for the response. It didn't work, but I think I left out something important in the past replies. I mentioned in my first post that when I call my localStorageDB, objects are returned. More specific: results are returned as arrays of object literals. First of all I need to initialise the localStorage db, second I need to query the db. That is probably why null was returned earlier. The code looks like this and I have included it in "genericService1JS":
var lib = new localStorageDB("fav", localStorage); //name of "db"
var q = lib.query("favSongs"); //name of "table"
In the Generic Service I've added "ID", "songTitle" and "musicalTitle" as response parameters.
Code: Select all
var p = JSON.parse(q);
var responseData = p;
console.log("ResponseData: "+p);
...I get: "SyntaxError: Unexpected token o".
Code: Select all
...
var s = JSON.stringify(q);
var responseData = s;
console.log("ResponseData: "+s);
... I get: "ResponseData: [{"ID":1,"code":1412183756865,"songTitle":"Empty Chairs at Empty Tables","musicalTitle":"Les Misérables"},{"ID":2,"code":1412183764562,"songTitle":"Bring Him Home","musicalTitle":"Les Misérables"}]"
I have tried to map the response to a list but the list is empty:
I hope this finally provides you with some good information about my project/problems.