diff options
author | Tatu Lund <tatu@vaadin.com> | 2019-04-02 13:46:29 +0300 |
---|---|---|
committer | Anastasia Smirnova <anasmi@utu.fi> | 2019-04-02 13:46:29 +0300 |
commit | 0035aa1d7a8645a3759d27864b95d83a4b8c2475 (patch) | |
tree | f750585ed58996461c8bcd7e95a0af1992aa1697 /client | |
parent | 2fa346be939b682e905528c67a531c6a8da9ebff (diff) | |
download | vaadin-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.java | 8 | ||||
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java | 4 |
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"); } |