summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2019-04-02 13:46:29 +0300
committerAnastasia Smirnova <anasmi@utu.fi>2019-04-02 13:46:29 +0300
commit0035aa1d7a8645a3759d27864b95d83a4b8c2475 (patch)
treef750585ed58996461c8bcd7e95a0af1992aa1697 /client
parent2fa346be939b682e905528c67a531c6a8da9ebff (diff)
downloadvaadin-framework-0035aa1d7a8645a3759d27864b95d83a4b8c2475.tar.gz
vaadin-framework-0035aa1d7a8645a3759d27864b95d83a4b8c2475.zip
setCaption of Panel did not honor setCaptionAsHtml (#11523)
Verify that correct mode(HTML/TEXT) of caption is set for the Panel Fixes #11521
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VPanel.java8
-rw-r--r--client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java4
2 files changed, 8 insertions, 4 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VPanel.java b/client/src/main/java/com/vaadin/client/ui/VPanel.java
index 6396b83336..d740c70fab 100644
--- a/client/src/main/java/com/vaadin/client/ui/VPanel.java
+++ b/client/src/main/java/com/vaadin/client/ui/VPanel.java
@@ -130,8 +130,12 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner,
}
/** For internal use only. May be removed or replaced in the future. */
- public void setCaption(String text) {
- DOM.setInnerHTML(captionText, text);
+ public void setCaption(String text, boolean captionAsHtml) {
+ if (captionAsHtml) {
+ captionText.setInnerHTML(text);
+ } else {
+ captionText.setInnerText(text);
+ }
}
/** For internal use only. May be removed or replaced in the future. */
diff --git a/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java b/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java
index f454e511be..44d60121b1 100644
--- a/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java
@@ -97,9 +97,9 @@ public class PanelConnector extends AbstractSingleComponentContainerConnector
panel.captionNode.setClassName(VPanel.CLASSNAME + "-caption");
boolean hasCaption = hasCaption();
if (hasCaption) {
- panel.setCaption(getState().caption);
+ panel.setCaption(getState().caption,getState().captionAsHtml);
} else {
- panel.setCaption("");
+ panel.setCaption("",false);
panel.captionNode.setClassName(VPanel.CLASSNAME + "-nocaption");
}