Page 1 of 1

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

Posted: Wed Nov 12, 2014 3:58 pm
by Marco Brenna

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


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

Posted: Wed Nov 12, 2014 5:07 pm
by Evgene Karachevtsev

Hello Marco,

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


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

Posted: Wed Nov 12, 2014 6:06 pm
by Marco Brenna

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


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

Posted: Wed Nov 12, 2014 7:15 pm
by Evgene Karachevtsev

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