diff options
author | Maciej Przepióra <matthew@vaadin.com> | 2015-09-16 10:48:31 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-09-24 07:46:38 +0000 |
commit | 5c875228d9025f4c779ffc26c3eb0f7b561061e5 (patch) | |
tree | 2e3a0d230478ef7d9090db31597e440f3f1738e7 /server/src/com/vaadin/ui/Grid.java | |
parent | 8006d359acce4fb31e7210ed2f20f1da3d7a1cd0 (diff) | |
download | vaadin-framework-5c875228d9025f4c779ffc26c3eb0f7b561061e5.tar.gz vaadin-framework-5c875228d9025f4c779ffc26c3eb0f7b561061e5.zip |
Support HTML entities when reading/writing declarative format #18882
Change-Id: I08099673c5dd0d688d3243e5fd169edb05f046f3
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 f762fe0664..ab3708ee28 100644 --- a/server/src/com/vaadin/ui/Grid.java +++ b/server/src/com/vaadin/ui/Grid.java @@ -108,6 +108,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; @@ -2273,7 +2274,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier, setHtml(cellElement.html()); } } else { - setText(cellElement.html()); + // text – need to unescape HTML entities + setText(DesignFormatter.unencodeFromTextNode(cellElement + .html())); } } } @@ -4981,7 +4984,7 @@ public class Grid extends AbstractFocusable 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 @@ -6752,7 +6755,8 @@ public class Grid extends AbstractFocusable 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()) : "")); } } } |