]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed issue with toggling tooltips on/off #5414
authorJohn Alhroos <john.ahlroos@itmill.com>
Tue, 16 Aug 2011 12:20:30 +0000 (12:20 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Tue, 16 Aug 2011 12:20:30 +0000 (12:20 +0000)
svn changeset:20417/svn branch:6.7

src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
src/com/vaadin/ui/Table.java

index 1f854f18f87af150f942e5f651ad3a836fdf8208..ad69d8a751cbf2e78bc24f4113bff71b8d39afb7 100644 (file)
@@ -4426,6 +4426,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
                 if (rowDescription != null && !rowDescription.equals("")) {
                     TooltipInfo info = new TooltipInfo(rowDescription);
                     client.registerTooltip(VScrollTable.this, rowElement, info);
+                } else {
+                    // Remove possibly previously set tooltip
+                    client.registerTooltip(VScrollTable.this, rowElement, null);
                 }
 
                 tHead.getColumnAlignments();
@@ -4526,9 +4529,12 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
                     }
                 }
 
-                if (description != null && client != null) {
+                if (description != null && !description.equals("")) {
                     TooltipInfo info = new TooltipInfo(description);
                     client.registerTooltip(VScrollTable.this, td, info);
+                } else {
+                    // Remove possibly previously set tooltip
+                    client.registerTooltip(VScrollTable.this, td, null);
                 }
 
                 td.appendChild(container);
index d9446de5d1773e741e4416178a22f56f26959ee8..fd18bf0fd78e10ac89c6e52253d69df6d314f203 100644 (file)
@@ -46,7 +46,6 @@ import com.vaadin.terminal.Resource;
 import com.vaadin.terminal.gwt.client.MouseEventDetails;
 import com.vaadin.terminal.gwt.client.ui.VScrollTable;
 import com.vaadin.terminal.gwt.client.ui.dd.VLazyInitItemIdentifiers;
-import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
 
 /**
  * <p>
@@ -4586,7 +4585,10 @@ public class Table extends AbstractSelect implements Action.Container,
      *                 The generator to use or null to disable
      */
     public void setItemDescriptionGenerator(ItemDescriptionGenerator generator){
-       itemDescriptionGenerator = generator;
+        if (generator != itemDescriptionGenerator) {
+            itemDescriptionGenerator = generator;
+            refreshRenderedCells();
+        }
     }
     
     /**