PolymerElement notified when server call done

Hi,

I’ve not found if there is a way to be notify on the client side when an event is finished on the server side.
I’m just interested in displaying a loading panel when calling server then removing it when finished.

Best regards,

Sounds like the [“Asynchronous updates”]
(https://vaadin.com/docs/v11/flow/advanced/tutorial-push-access.html) chapter in the docs explains what you want: https://vaadin.com/docs/v11/flow/advanced/tutorial-push-access.html . Basically: run the long task in a separate background thread (using executors if possible), then remove the panel when the thread completes and Server Push will make sure the UI state is correctly updated.

Thanks for your answer.
Yeah I can do it like this.
But I won’t enable push on my application.

My question was more about the client side. Is there any function (callback?) automatically called in the PolymerElement after an event ended on the server side ?

Regards,

Well, Push is really the most optimal way. There is also helper tool for Async UI updates available for Flow, with it you do not have to write the boiler plate code yourself and kinda does what you are looking after

https://vaadin.com/directory/component/async-manager

OK, thank you.

I think we gonna re-consider Push.

I’m gonna take a look at the Async Manager.

Thanks again!