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.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
refresh order
Hi,
please help me with refreshing Label element.
My algorithm is:
1) grid.getContainerDataSource().removeAllItems();
2) label.setValue("getting data from " + ipAddress.getValue() + "...");
3) data = snmpWalk.getFDB(ipAddress.getValue(),community); //long run operation 3-10 seconds
4) grid.setContainerDataSource(new BeanItemContainer<>(FDBentry.class, data));
5) label.setValue("table from " + ipAddress.getValue());
But when program is runing and refresh Button is pressed I don't see what label is chaged to "getting data...."
I see small blue progress bar on top of the screen, then result.
Hello,
It will never work the way you do it. Vaadin is running your code until the end before refreshing screen. So you always wait 3 to 10 seconds then see final result in your label.
You should use some callbacks.
Some leads :
- https://vaadin.com/blog/-/blogs/no-more-waiting-vaadin-7-1-is-here-with-asynchronous-push
- https://vaadin.com/docs/-/part/framework/components/components-progressbar.html
HTH
Sébastien