diff --git a/src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java b/src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java index 8ae83a66617..a41d72113ae 100644 --- a/src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java +++ b/src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java @@ -39,6 +39,8 @@ import org.opencms.gwt.shared.CmsAdditionalInfoBean; import org.opencms.gwt.shared.CmsListInfoBean; +import com.google.gwt.dom.client.Element; +import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.HTML; /** @@ -155,6 +157,13 @@ public CmsResultItemWidget(CmsResultItemBean infoBean, boolean showPath) { } + private static Element appendDom(Element parent, String name) { + + Element child = DOM.createElement(name); + parent.appendChild(child); + return child; + } + /** * Gets the image tile.

* @@ -213,16 +222,17 @@ protected void onDetach() { */ private String generateTooltipHtml(CmsListInfoBean infoBean) { - StringBuffer result = new StringBuffer(); - result.append("

").append(CmsClientStringUtil.shortenString(infoBean.getTitle(), 70)).append("

"); + Element root = DOM.createElement("div"); + appendDom(appendDom(root, "p"), "b").setInnerText(CmsClientStringUtil.shortenString(infoBean.getTitle(), 70)); if (infoBean.hasAdditionalInfo()) { for (CmsAdditionalInfoBean additionalInfo : infoBean.getAdditionalInfo()) { - result.append("

").append(additionalInfo.getName()).append(": "); - // shorten the value to max 45 characters - result.append(CmsClientStringUtil.shortenString(additionalInfo.getValue(), 45)).append("

"); + appendDom(root, "p").setInnerText( + additionalInfo.getName() + + ":\u00a0" + + CmsClientStringUtil.shortenString(additionalInfo.getValue(), 45)); } } - return result.toString(); + return root.getInnerHTML(); } /**