I have to use an external api, which may be slow, so I'm using javascript to send the request asynchronously. When the response it's back, I need to update the JSF component.
Actually I'm using a remotecommand to do this, it calls a method on the bean which reloads the component (datatable). The thing is, if the user is doing some other action and I reload the component I could affect the user experience (eg. the user already went to the next page of the datatable and when the reloads happens the datatable goes back to the first page)
So my question is, which would be the correct way of updating a component asynchronously when the user is performing other actions on the same page?
Also, could I have concurrency problems if instead of reloading the entire datatable, I modify an object of the list and then update the UI?