Ivan6481911
Posts: 0
Joined: Tue Dec 10, 2013 11:25 am

REST service callback when finished

Hello. I want to get callback from REST service, which download multiple audio files asynchronously by FileTransfer. I have XML file and I go though each object, get link and start downloading file.
Events "Success" and "Complete" are called too fast (when code is done, but files are still downloading). Would you please give appropriate solution to resolve task.
Perhaps, it has to be number of objects in XML which I will be decrementing... How to get it? Or some other solution.
Thanks!

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

REST service callback when finished

Hello! Here is how to count number of elements in response https://getsatisfaction.com/apperyio/... or just increment variable value in mapping for each component.
You can add delay before complete function is invoked using setInterval https://developer.mozilla.org/en-US/d...

Ivan6481911
Posts: 0
Joined: Tue Dec 10, 2013 11:25 am

REST service callback when finished

Thanks!

Himanshu
Posts: 0
Joined: Mon Mar 31, 2014 9:46 am

REST service callback when finished

How can I get the number of counts in "Complete" event?

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

REST service callback when finished

Hello Himanshu,

Could you please provide us with more information about your question?

Himanshu
Posts: 0
Joined: Mon Mar 31, 2014 9:46 am

REST service callback when finished

Hi Evgene.. Actually I have a list to show on the page, And based on the list I am showing/hiding a div on that page. But because the list is huge....30-40 lines, and If I do Show/hide in Success event, then it don't show full list, but only some lines. So I am thinking to do it in Complete event, instead of success. And so I need number of items in complete event.. to show/hide that div.

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

REST service callback when finished

Hi Himanshu,

You can obtain all service response on Success event (it is in variable 'data') or process list records one by one using JS code for list item mapping.

Return to “Issues”