Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Update components dinamically

William Valencia Acosta
10 years ago Mar 09, 2012 11:00pm

Hello Everyone,

I need help, I want to "refresh" a Window that contains a CustomComponent with panels. I want to show in this window how their panels are changing, Im using Thread.sleep to stop the time, then remove the panels and put another one, but it doesnt work... any help plz? Thanks.

Marko Grönroos
10 years ago Mar 10, 2012 1:11pm

I'm not quite sure what you are trying to do. The use of Thread.sleep() sound suspicious. Please note that the Vaadin development model is event-driven and you can't show the user something, then sleep, and then show something else. The UI is refreshed only after handling the server request and any sleeping just delays that. If you want timed changes in the UI, you need to use polling, such as with the Refresher add-on, or server-side push (several add-ons).

Last updated on Mar, 10th 2012
ElectroGioJava Electro Johanness
10 years ago Mar 12, 2012 8:09pm

Resolve it with executeJavascript.("script JS to refresh");

William Valencia Acosta
10 years ago Mar 13, 2012 8:35pm

Thanks! It's Work. Excellent.