summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java
index 3372f28eac..98d3ac7077 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IForm.java
@@ -58,8 +58,10 @@ public class IForm extends ComplexPanel implements Paintable,
return;
}
+ boolean legendEmpty = true;
if (uidl.hasAttribute("caption")) {
DOM.setInnerText(caption, uidl.getStringAttribute("caption"));
+ legendEmpty = false;
} else {
DOM.setInnerText(caption, "");
}
@@ -69,11 +71,17 @@ public class IForm extends ComplexPanel implements Paintable,
DOM.insertChild(legend, icon.getElement(), 0);
}
icon.setUri(uidl.getStringAttribute("icon"));
+ legendEmpty = false;
} else {
if (icon != null) {
DOM.removeChild(legend, icon.getElement());
}
}
+ if (legendEmpty) {
+ DOM.setStyleAttribute(legend, "display", "none");
+ } else {
+ DOM.setStyleAttribute(legend, "display", "");
+ }
if (uidl.hasAttribute("error")) {
final UIDL errorUidl = uidl.getErrors();