find the below API Response.
{
"message":"testing1",
"processed":0,
"total":10
}
and I am trying to implement the ui which shows the API data, we need to call the api multiple times in a loop("processed" will get increase on each api call) until the api response.processed = response.total . each time I need to update the UI widget(message details), once the condition is satisfied I need to display some other UI widget (number of api calls with download button).
please help me on this
In your UI, set an Expression tied to a local variable to show the values you want to show on screen, within a container around it.
Then, on each loop, update that local variable and follow it with an ajax refresh on that container.
Not entirely sure this will work since I haven't had this need in Traditional web but give it a go
Check this link:
https://liuzhenglaichn.gitbook.io/system-design/advanced/server-to-client-communication
You could implement the "Long Polling" technique -> Web Block, having the UI functionality you want, that makes a call to a Server (or a Sevice) Action on your back end, which in turn calls the REST.