Page 1 of 1
DataBinding a localStorage variable
Posted: Sun Aug 18, 2013 9:17 am
by Carles Cabré Boixados
Hello
I have a RestService binding with some controls in my page. Once data recovery data RestService keep localStorage variable.
I would like to check if I have a localStorage variable data and if so binding to controls and if not call RestService
Is possible to accomplish this called a Generic (custom JavaScript implementation) for example.
How you would have to do?
DataBinding a localStorage variable
Posted: Sun Aug 18, 2013 11:16 am
by Igor
Hello,
On next doc you can find how to invoke the service: http://docs.appery.io/documentation/u....
[quote:]
to check if I have a localStorage variable data and if so binding to controls
[/quote]
You should check if you have the same value in localStorage and in the component. It's very simple to do. Can you provide additional information why do you want to do such validation?
[quote:]
if not call RestService
[/quote]
You can add additional lacalStorage variable and set it value "true" or "false" when service was invoked and then use this variable in validation.
You can use such validation on page load event.
DataBinding a localStorage variable
Posted: Thu Jan 22, 2015 1:19 am
by Aeneas McBurney
Hi,
This question wasn't really answered properly and I am trying to do something similar. I have a list that I fill with a data service which returns json data. I also populate a localStorage variable with this same json data set. I want to be able to edit, add and delete from the localStorage dataset and then rebind the list to this dataset when done. How do I do this in javascript?
Thanks,
Aeneas
DataBinding a localStorage variable
Posted: Thu Jan 22, 2015 12:48 pm
by Illya Stepanov
Hi Aeneas -
This document should be helpful and shows how to change values in the local Storage variable:
http://devcenter.appery.io/documentat...
We don't have a code snippet this is something that should be coded by you.
DataBinding a localStorage variable
Posted: Thu Jan 22, 2015 5:23 pm
by Aeneas McBurney
Hi, I know how to change the values in local storage variable but I don't know how to bind the data in list back to this changed localstorage variable. How do I do this?
DataBinding a localStorage variable
Posted: Fri Jan 23, 2015 2:30 pm
by Alena Prykhodko
This is an example how to bind response to list, same with LSV.
Your data should be an array.
DataBinding a localStorage variable
Posted: Fri Jan 23, 2015 4:24 pm
by Aeneas McBurney
There is no example here? I have found a way to do it using echo.
DataBinding a localStorage variable
Posted: Mon Jan 26, 2015 9:45 pm
by Illya Stepanov
You can use Generic service (http://devcenter.appery.io/documentat...)
1) Create generic service
2) On success send back array or object back (try to use static value for test purposes first);
3) Create response on test tab;
4) Use it in your mapping.
DataBinding a localStorage variable
Posted: Mon Jan 26, 2015 9:55 pm
by Aeneas McBurney
Yes thanks I have already found solution with the echo of a service