Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

edit data in success event of service

Hi Andrés,

There seems to be no possibility to check the option from the code.
Maybe you can rethink your app design.

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

edit data in success event of service

Ok, so I can test the app before uploading to a device, I have installed this plugin in my Firefox, so it doesn't check for the security of the REST request:
https://addons.mozilla.org/en-US/fire...

Using it, I don't need the Appery proxy, so I can go on testing the app :-)

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

edit data in success event of service

Yes, when running a native (hybrid) app, you don't need the proxy: http://docs.appery.io/documentation/a...

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

edit data in success event of service

If I don't use the CORS plugin, the REST service fails and the error is the same:
Line 34: this.settings.error(jqXHR, textStatus, errorThrown);

It seems that this part of your code can't get the error message correctly?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

edit data in success event of service

Hello! This error can occur only if you miss
codethis.settings = settings;/code line
Please check if you have this line as in example posted by Sergey Kozyr (where process method starts).

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

edit data in success event of service

Hello Marina.

I didn't have that line :-(

Adding that line now it works! Thank you very much.

My mistake was that I used as "template" the demo code that is created when you create the service, which didn't have that line:

code$t.PruebaBorrar = $t.createClass(null, {

init : function(requestOptions) {
this.__requestOptions = $.extend({}, requestOptions);
},

process : function(settings) {
if (this.requestOptions.echo) {
settings.success(this.requestOptions.echo);
} else {
console.log('Default implementation is used. Please define your own.');
settings.success({});
}
settings.complete('success');
}

});/code

Return to “Issues”