]> source.dussan.org Git - vaadin-framework.git/commitdiff
Button fixes (icon, description, error toggling)
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 29 Nov 2007 07:07:45 +0000 (07:07 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 29 Nov 2007 07:07:45 +0000 (07:07 +0000)
svn changeset:3028/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IButton.java

index ce230247e6735f71a39652cf649db29f4d3f0c23..74b211bb0b01043c222484eb74c72f2ad1a1683c 100644 (file)
@@ -79,7 +79,8 @@ public class IButton extends Button implements Paintable {
             errorMessage.updateFromUIDL(errorUidl);
 
         } else if (errorIndicatorElement != null) {
-            DOM.setStyleAttribute(errorIndicatorElement, "display", "none");
+            DOM.removeChild(getElement(), errorIndicatorElement);
+            errorIndicatorElement = null;
         }
 
         if (uidl.hasAttribute("icon")) {
@@ -88,11 +89,18 @@ public class IButton extends Button implements Paintable {
                 DOM.insertChild(getElement(), icon.getElement(), 0);
             }
             icon.setUri(uidl.getStringAttribute("icon"));
+        } else {
+            if (icon != null) {
+                DOM.removeChild(getElement(), icon.getElement());
+                icon = null;
+            }
         }
 
         // handle description
         if (uidl.hasAttribute("description")) {
             setTitle(uidl.getStringAttribute("description"));
+        } else {
+            setTitle(null);
         }
 
     }