Page 1 of 1

Unable to override echo

Posted: Sat Oct 25, 2014 12:15 pm
by Simon McGinnes

I want to populate a list from an array. So I am overriding the __requestOptions.echo value as suggested at http://devcenter.appery.io/documentat....

The alerts show that the echo value was undefined before I set it, and was then set to the new value. However, when I execute the code below, the list is populated using the example echo items that I entered for the service, not the items that I am supplying at run time.

Code: Select all

 alert("before ~" + skillsEchoService.__requestOptions.echo + "~"); 

 var echoJSON = '[{"skillName":"woodworking"}, {"skillName":"dancing"}]'; 
 skillsEchoService.__requestOptions.echo = echoJSON; 

 alert("after ~" + skillsEchoService.__requestOptions.echo + "~"); 

 skillsEchoService.execute(); 
 Appery("skillsAddedList").listview("refresh"); 

What am I doing wrong?


Unable to override echo

Posted: Sat Oct 25, 2014 2:11 pm
by obullei

Hello!

Please take a look at this thread: https://getsatisfaction.com/apperyio/...


Unable to override echo

Posted: Sat Oct 25, 2014 2:28 pm
by Simon McGinnes

Hi Arina,

Yes, I have seen that thread. Can you suggest why my code is not working? The echo response type is set to 'JSON'.


Unable to override echo

Posted: Mon Oct 27, 2014 1:45 am
by Yurii Orishchuk

Hi Simon,

Here is correct code for you:

pre

alert("before ~" + listService2.service.__requestOptions.echo + "~");

var echoJSON = '[{"name":"woodworking"}, {"name":"dancing"}]';
listService2.service.__requestOptions.echo = echoJSON;

alert("after ~" + listService2.service.__requestOptions.echo + "~");

listService2.execute();

/pre

Note: you should use your service datasource and your service response.

Regards.