Author: jacopoc
Date: Sat Feb 24 00:33:12 2007
New Revision: 511239
URL:
http://svn.apache.org/viewvc?view=rev&rev=511239Log:
Applied patch from Adrian Crum (OFBIZ-759) for the screen renderer to prevent the creation of empty <span> elements when there is no text to display.
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java?view=diff&rev=511239&r1=511238&r2=511239==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlScreenRenderer.java Sat Feb 24 00:33:12 2007
@@ -85,6 +85,11 @@
}
public void renderLabel(Writer writer, Map context, ModelScreenWidget.Label label) throws IOException {
+ String labelText = label.getText(context);
+ if (UtilValidate.isEmpty(labelText)) {
+ // nothing to render
+ return;
+ }
// open tag
String style = label.getStyle(context);
String id = label.getId(context);
@@ -104,13 +109,13 @@
writer.write(">");
// the text
- writer.write(label.getText(context));
+ writer.write(labelText);
// close tag
writer.write("</span>");
} else {
- writer.write(label.getText(context));
+ writer.write(labelText);
}
appendWhitespace(writer);