Marco Brenna
Posts: 0
Joined: Tue Jan 21, 2014 3:34 pm

Update appery.io components using a cached json from a previous service call

Hi,
I'm used to use:
servicename.updateComponents(responseCachedJSON);
for update components on appery.io with a cached Json. Since the new appery.io interface arrives it seems that this code doesn't work any more (perhaps due to the new mapping interface for services).
How can I reach the same behaviour with javascript and the new appery.io interface (update components with a cached json)?
Is there an api reference for new javascript functions?

Thanks

Marco

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Update appery.io components using a cached json from a previous service call

Hello Marco,

You can make the mapping from storage variable or you can use the echo service parameter
http://devcenter.appery.io/documentat...

Marco Brenna
Posts: 0
Joined: Tue Jan 21, 2014 3:34 pm

Update appery.io components using a cached json from a previous service call

Hi Evgene,

thanks for the reply. I haven't clear how to make mapping through storage variable. I already have the full json response as string as a storage variable. I need to automatically map that json with the appery.io components without recalling the service (exactly the thing that updateComponents method do).
I haven't tried to use echo yet but the documentation you linked says:
em"Be sure to turn off the Echo service when using the app in production."/em
I haven't understand if this note is valid also if I use echo with javascript... can you clarify please?
Any other suggestions for solve the problem? It will be great if I can use again the updateComponents method or a similar way because with one line of code it makes exactly what I want. If you confirm that use echo with javascript in production is safe I'll go for that.

Thanks again

Marco

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Update appery.io components using a cached json from a previous service call

Marco,

Please try the following
pretest_list_service.requestOptions.echo = '[{"id":"11111111","createdAt":"2013-05-23 13:59:24.980","updatedAt":"2014-10-03 19:50:20.114", "s":"6","n":1},{"id":"22222222222","createdAt":"2013-05-27 15:36:27.002","updatedAt":"2014-10-03 19:50:18.311","s":"5","n":1}]';
restservice1.execute();
test_list_service.requestOptions.echo = ";/pre
Where test_list_service is the service name
restservice1 is the name of the instance of the service test_list_service on the page

Return to “Issues”