]> source.dussan.org Git - vaadin-framework.git/commitdiff
merged [9596] from 6.1
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 3 Nov 2009 09:07:32 +0000 (09:07 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 3 Nov 2009 09:07:32 +0000 (09:07 +0000)
svn changeset:9597/svn branch:6.2

src/com/vaadin/terminal/gwt/client/ui/VProgressIndicator.java

index 58d4d5c021095acf9df0a18bc30e1358e13f6f06..ab9f20bcc375795d332d401acc00ed7773c6a3e5 100644 (file)
@@ -21,6 +21,7 @@ public class VProgressIndicator extends Widget implements Paintable {
     private final Poller poller;
     private boolean indeterminate = false;
     private boolean pollerSuspendedDueDetach;
+    private int interval;
 
     public VProgressIndicator() {
         setElement(DOM.createDiv());
@@ -33,12 +34,10 @@ public class VProgressIndicator extends Widget implements Paintable {
     }
 
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
-        if (client.updateComponent(this, uidl, true)) {
-            return;
-        }
-
-        poller.cancel();
         this.client = client;
+        if (!uidl.getBooleanAttribute("cached")) {
+            poller.cancel();
+        }
         if (client.updateComponent(this, uidl, true)) {
             return;
         }
@@ -61,7 +60,8 @@ public class VProgressIndicator extends Widget implements Paintable {
         }
 
         if (!uidl.getBooleanAttribute("disabled")) {
-            poller.scheduleRepeating(uidl.getIntAttribute("pollinginterval"));
+            interval = uidl.getIntAttribute("pollinginterval");
+            poller.scheduleRepeating(interval);
         }
     }
 
@@ -69,7 +69,7 @@ public class VProgressIndicator extends Widget implements Paintable {
     protected void onAttach() {
         super.onAttach();
         if (pollerSuspendedDueDetach) {
-            poller.run();
+            poller.scheduleRepeating(interval);
         }
     }