How to scheduled an UI update

You can enable Push on the application and the scheduler from Spring Boot then you can use this code in your MainLayout (or only for this view):

@Scheduled(fixedRate = 1000)
public void scheduleFixedRateTask() {
	getUI().ifPresent(ui -> {
			ui.access(() -> {
       // refresh your page
       }
    }
}

For a countdown, you can probably use a custom component that does the countdown on the client side but that’s probably premature optimization :slight_smile:

1 Like