Browse Source

Fixed #1022 , at least for all layouts that use caption (wrapper) when handling general component changes such as icon, caption, errormsg.

svn changeset:2565/svn branch:trunk
tags/6.7.0.beta1
Jani Laakso 16 years ago
parent
commit
2f195c5989
1 changed files with 16 additions and 0 deletions
  1. 16
    0
      src/com/itmill/toolkit/terminal/gwt/client/Caption.java

+ 16
- 0
src/com/itmill/toolkit/terminal/gwt/client/Caption.java View File

@@ -14,6 +14,8 @@ public class Caption extends HTML {

private Element errorIndicatorElement;

private Element icon;

private Element captionText;

private ErrorMessage errorMessage;
@@ -50,12 +52,26 @@ public class Caption extends HTML {
DOM.setStyleAttribute(errorIndicatorElement, "display", "none");
}

if (uidl.hasAttribute("icon")) {
if (icon == null) {
icon = DOM.createImg();
DOM.appendChild(getElement(), icon);
}
DOM.setElementAttribute(icon, "src", uidl
.getStringAttribute("icon"));
} else {
if (icon != null)
DOM.removeChild(getElement(), icon);
}

if (uidl.hasAttribute("caption")) {
if (captionText == null) {
captionText = DOM.createSpan();
DOM.appendChild(getElement(), captionText);
}
DOM.setInnerText(captionText, uidl.getStringAttribute("caption"));
} else {
// TODO should span also be removed
}

if (uidl.hasAttribute("description")) {

Loading…
Cancel
Save