diff options
Diffstat (limited to 'server/src/com/vaadin/ui/Grid.java')
-rw-r--r-- | server/src/com/vaadin/ui/Grid.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java index c57d9d523b..12d800c1a6 100644 --- a/server/src/com/vaadin/ui/Grid.java +++ b/server/src/com/vaadin/ui/Grid.java @@ -100,6 +100,7 @@ import com.vaadin.shared.util.SharedUtil; import com.vaadin.ui.declarative.DesignAttributeHandler; import com.vaadin.ui.declarative.DesignContext; import com.vaadin.ui.declarative.DesignException; +import com.vaadin.ui.declarative.DesignFormatter; import com.vaadin.ui.renderers.HtmlRenderer; import com.vaadin.ui.renderers.Renderer; import com.vaadin.ui.renderers.TextRenderer; @@ -1928,7 +1929,9 @@ public class Grid extends AbstractComponent implements SelectionNotifier, setHtml(cellElement.html()); } } else { - setText(cellElement.html()); + // text – need to unescape HTML entities + setText(DesignFormatter.unencodeFromTextNode(cellElement + .html())); } } } @@ -4607,7 +4610,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier, /* * This method is a workaround for the fact that Vaadin re-applies * widget dimensions (height/width) on each state change event. The - * original design was to have setHeight an setHeightByRow be equals, + * original design was to have setHeight and setHeightByRow be equals, * and whichever was called the latest was considered in effect. * * But, because of Vaadin always calling setHeight on the widget, this @@ -6252,7 +6255,8 @@ public class Grid extends AbstractComponent implements SelectionNotifier, Object value = datasource.getItem(itemId) .getItemProperty(c.getPropertyId()).getValue(); tableRow.appendElement("td").append( - (value != null ? value.toString() : "")); + (value != null ? DesignFormatter + .encodeForTextNode(value.toString()) : "")); } } } |