Author: hfnukal
Date: 2011-04-19 08:15:46 -0400 (Tue, 19 Apr 2011)
New Revision: 6280
Modified:
epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
Log:
JBEPP-773 "Preferences" tab is only showing up if portlet has been customized
(Only possible though portal.xml)
Modified:
epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2011-04-19
11:44:39 UTC (rev 6279)
+++
epp/portal/branches/EPP_5_1_Branch/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2011-04-19
12:15:46 UTC (rev 6280)
@@ -167,12 +167,13 @@
UIForm uiForm = getAncestorOfType(UIForm.class);
for (UIComponent inputEntry : getChildren())
{
- if (inputEntry instanceof UIFormInputBase)
+ if (inputEntry.isRendered())
{
- if (inputEntry.isRendered())
+ String label = "";
+ boolean hasLabel = false;
+ if (inputEntry instanceof UIFormInputBase)
{
UIFormInputBase formInputBase = (UIFormInputBase) inputEntry;
- String label;
if (formInputBase.getLabel() != null)
{
label = uiForm.getLabel(res, formInputBase.getLabel());
@@ -181,20 +182,24 @@
{
label = uiForm.getLabel(res, formInputBase.getId());
}
- w.write("<tr>");
- w.write("<td class=\"FieldLabel\">");
-
- // if missing resource and the label hasn't been set before, don't
print out the label.
if (formInputBase.getLabel() != null || (label != formInputBase.getId()))
{
- w.write(label);
+ hasLabel = true;
}
- w.write("</td>");
- w.write("<td class=\"FieldComponent\">");
- renderUIComponent(formInputBase);
- w.write("</td>");
- w.write("</tr>");
}
+ w.write("<tr>");
+ w.write("<td class=\"FieldLabel\">");
+
+ // if missing resource and the label hasn't been set before, don't
print out the label.
+ if (hasLabel)
+ {
+ w.write(label);
+ }
+ w.write("</td>");
+ w.write("<td class=\"FieldComponent\">");
+ renderUIComponent(inputEntry);
+ w.write("</td>");
+ w.write("</tr>");
}
}
w.write("</table>");