reload a page periodically


what’is the best way to reload a table from database periodically, traditionaly i add :

<meta id="meta1" content="30" http-equiv="Refresh"/>

i try whith javascript :
setTimeout but this not work with : [code]



Use the

it’s removed from incubator

It’s been moved to contrib (

I work in the same project with Walid
I used the refresher.jar like in the picture but when i run it, it loops without result.

can you help me please.

My web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" id="WebApp_ID" version="2.5">
  	Vaadin production mode</description>
  		Vaadin application class to start</description>
  		Application widgetset</description>

Hi guys,

You actually need to also start a background thread that actually updates the table. The Refresher component only polls for UI changes, but nothing will happen if there are none (i.e. nothing will happen if the table’s items haven’t changed).

Remember to synchronize on your Application instance when you modify UI components from a background thread.


solved by the progress indicator sample :

 public class Worker1 extends Thread {

        int current = 1;
        public final static int MAX = 20;

        public void run() {
            boolean b = true;
            while (b) {
                current = 1;

                for (; current <= MAX; current++) {
                    try {
                    } catch (InterruptedException e) {

                    // All modifications to Vaadin components should be synchronized
                    // over application instance. For normal requests this is done
                    // by the servlet. Here we are changing the application state
                    // via a separate thread.
                    synchronized (mainWindow.getApplication()) {
                String d = FctDate.dateToString((Date) datePopup.getValue(), "dd/MM/yy");
                synchronized (mainWindow.getApplication()) {


  private void prosessed2(String d) {

Hi all,
I tryed another way:

a (css)hidden NativeButton with ID set via setDebugId()
automatically “clicked” via javascript with:

String script = "setTimeout(\"document.getElementById('btnRefresh').click()\","+ MilliSec + ")";

It’s trivial but does not require Refresher, or ProgressIndicator and new threads.
Before this, I tried the ProgressIndicator way, and I fear that, once started, the new thread will remain active even when user leaves the page.

Any suggestion is welcome!


I think to remember that the debug ids are stripped when running the release build (as they are for debug purpose). I would not rely on them for anything as it may end up having strange effects when put in production (broken CSS, broken javascript, …).

ProgressIndicator does not use new threads either on the server or on the client. It sets up a timer on the client side which triggers a (practically empty) request to the server, just to allow the server to respond as the server cannot initiate connections. Your button clicks effectively do the same except that the request actually has a slightly different payload (“this button was clicked”). If I remember correctly, you can register a listener for the progress indicator refresh requests if you want to do them explicitly.

ProgressIndicator then resets the timer whenever it is triggered to achieve periodic refreshes. The timer only gets used and reset while it is on the visible page, so if you want it to be active in all views of your application, you should place it in some root layout that does not get changed (or in some other layout in each view).

Trying to learn from demos, I was missing this point.
Thank you!