Page 2 of 2

edit data in success event of service

Posted: Wed May 29, 2013 11:05 am
by Kateryna Grynko

Hi Andrés,

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


edit data in success event of service

Posted: Sun Jun 02, 2013 6:03 pm
by Andrés Méndez

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 :-)


edit data in success event of service

Posted: Sun Jun 02, 2013 6:05 pm
by maxkatz

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


edit data in success event of service

Posted: Sun Jun 02, 2013 6:06 pm
by Andrés Méndez

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?


edit data in success event of service

Posted: Mon Jun 03, 2013 8:16 am
by Maryna Brodina

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


edit data in success event of service

Posted: Mon Jun 03, 2013 7:18 pm
by Andrés Méndez

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