Possible to set ConfirmDialog Synchronous?
Hi,
I tried to make a user's validation on each object of a collection (in a loop), but actually ConfirmDialog.show() isn't blocking and the loop finish before to display it.
Have you an issue for this case? Or it's impossible actually?
Thank
(Sorry for my English)
Yes, you right. The underlying communication is still asynchronous (XHR most likely). So if you want to pipeline them (one after another) you need to chain the callbacks. Or maybe a place to use Java 8 stream APIs?
This is definitely not possible. The Vaadin UI thread cannot block in the show() method - it must finish and deliver the new content (along with the dialog to be shown) to the browser. The only way this could be done is via continuations: https://kotlinlang.org/docs/reference/coroutines.html
Please read this blogpost regarding blocking dialogs: http://mavi.logdown.com/posts/3488105 Here is a sample project: https://github.com/mvysny/vaadin-coroutines-demo