Simon McGinnes
Posts: 0
Joined: Tue Oct 21, 2014 6:41 am

Unable to override echo

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?

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Unable to override echo

Hello!

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

Simon McGinnes
Posts: 0
Joined: Tue Oct 21, 2014 6:41 am

Unable to override echo

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'.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Unable to override echo

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.

Return to “Issues”