RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Accessing data returned by service on success event

Before (and even for a short time during) the update problems I was able to use JSON.stringify and/or JSON.parse to manipulate the success-event response to my get_top10_addresses service.

I now have tried all manner of combinations and am unable to do it after the rollback - so I don't know if I'm doing something wrong or there's been a change in the success object. Can you please show me the code to be able to manipulate what's being returned by the service on the success event. Thank you.

function bobService(v,v2){

get_top10_addresses.execute({
success: function(jqXHR) {
//WORKS alert('success with latlon ' + v + ' which is iteration number ' + v2);

},
error: function( e ) {
//Error handler here
},
complete: function(jqXHR) {
//Complete handler here

},
});
}

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

Accessing data returned by service on success event

Hi Robert,

Try outputting jqXHR on Success event to see what is available (a string response from service that can be parsed via JSON.parse()).

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Accessing data returned by service on success event

Thank you Katya.

When I do:
alert('jqXHR = ' + jqXHR);
... I get http://screencast.com/t/Vg72bAtsMYG

When I then do:
alert('JSON.parse(jqXHR) = ' + JSON.parse(jqXHR));
... I get http://screencast.com/t/5yDCDNTo

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Accessing data returned by service on success event

Hello Robert,

Could you please share your application with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a
http://devcenter.appery.io/documentat...
And send us project's name, name of page with service and name of service

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Accessing data returned by service on success event

App is called BlockFacts and is shared. The function is in my JavaScript folder and is called BobService and calls the get_top10_addresses service. To replicate problem:

  1. load app
    2.click log in

  2. click current location

  3. click plus icon in header

  4. click top 10 neighborhoods

  5. click update list

    The function works fine, except I cannot access the data returned on the success event in my function.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Accessing data returned by service on success event

Robert,

We don't see you project. But you can try seeing value of jqXHR using consol.log(jqXHR) and see what values return from server.

Dave Troxel
Posts: 0
Joined: Fri May 09, 2014 1:07 pm

Accessing data returned by service on success event

Careful you do not become a beta tester all over again. Yesterday was enough for me. I'll wait. Hope your client/s are ok with it. Good luck man.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Accessing data returned by service on success event

Evgene, I'll do that as soon as I get back to the office and report back here. But, and I'm afraid to ask, why aren't you able to see my project - as I say, it's called BlockFacts.and I can work with it via the UI?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Accessing data returned by service on success event

Robert,

Sorry for misunderstood, we are able to see it.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

Accessing data returned by service on success event

No problem Evgene, glad you can see it.
I switched from Firefox to Chrome and added console.log(jqXHR) to the success code but see nothing in the debugger. I now cannot even see a simple Alert. I simply don't know what's happening.

Return to “Issues”