Hello! Please take a look at the screenshot
OK! Get it!
I'm still using the old editor ( have been using it since the current project began, and never got chance to switch to the new one).
So, I create a new REST service and use javascript:
serviceInstance.execute({});
to invoke service on some event, right?
That's quite smart. I like Tiggzi.
Anyway, thus far I have got a working around, i.e.
(1) I extract all those localStorage items that I want to save in the database,
(2) put them in one newly created item,
(3) then map this localStorage to the {data} parameter of the REST service that I invoke on click event.
Any comments?
To set all data from localStorage into the object you can use the next code:
codevar i, len, values = {}, keyName;
for (i = 0, len = localStorage.length; i < len; i++){
keyName = localStorage.key(i);
values[keyName] = localStorage.getItem(keyName);
}/code
Then if you need to fill a certain field with that data (in JSON format for example) you cam map variable to the parameter and add the next code to mapping:
codevar i, len, values = {}, keyName;
for (i = 0, len = localStorage.length; i < len; i++){
keyName = localStorage.key(i);
values[keyName] = localStorage.getItem(keyName);
}
return JSON.stringify(values);/code
Great! Your last comment is noted.
Great! Your last comment is noted. Thx!