You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2010/06/01 13:12:40 UTC
svn commit: r950019 - in /ofbiz/trunk/framework/widget:
src/org/ofbiz/widget/form/ templates/
Author: jonesde
Date: Tue Jun 1 11:12:40 2010
New Revision: 950019
URL: http://svn.apache.org/viewvc?rev=950019&view=rev
Log:
Added id to field titles to allow more direct styling, hiding/showing, etc
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=950019&r1=950018&r2=950019&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java Tue Jun 1 11:12:40 2010
@@ -1149,6 +1149,8 @@ public class MacroFormRenderer implement
String tempTitleText = modelFormField.getTitle(context);
String titleText = UtilHttp.encodeAmpersands(tempTitleText);
String style = modelFormField.getTitleStyle();
+ String id = modelFormField.getCurrentContainerId(context);
+
StringBuilder sb = new StringBuilder();
if (UtilValidate.isNotEmpty(titleText)) {
if (" ".equals(titleText)) {
@@ -1223,6 +1225,11 @@ public class MacroFormRenderer implement
}
sr.append("\" title=\"");
sr.append(sb.toString());
+ if (UtilValidate.isNotEmpty(id)) {
+ sr.append("\" id=\"");
+ sr.append(id);
+ sr.append("_title");
+ }
sr.append("\" />");
executeMacro(writer, sr.toString());
}
Modified: ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl?rev=950019&r1=950018&r2=950019&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl Tue Jun 1 11:12:40 2010
@@ -50,7 +50,7 @@ under the License.
<#macro renderHiddenField name value id event action></#macro>
<#macro renderIgnoredField></#macro>
-<#macro renderFieldTitle style title fieldHelpText=""><@renderField title />, </#macro>
+<#macro renderFieldTitle style title id fieldHelpText=""><@renderField title />, </#macro>
<#macro renderSingleFormFieldTitle></#macro>
<#macro renderFormOpen linkUrl formType targetWindow containerId containerStyle autocomplete name useRowSubmit></#macro>
Modified: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=950019&r1=950018&r2=950019&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Tue Jun 1 11:12:40 2010
@@ -71,7 +71,7 @@ under the License.
<#macro renderHiddenField name value id event action></#macro>
<#macro renderIgnoredField></#macro>
-<#macro renderFieldTitle style title fieldHelpText="">${title?default("")}</#macro>
+<#macro renderFieldTitle style title id fieldHelpText="">${title?default("")}</#macro>
<#macro renderSingleFormFieldTitle title>${title?default("")}</#macro>
<#macro renderFormOpen linkUrl formType targetWindow containerId containerStyle autocomplete name useRowSubmit></#macro>
Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=950019&r1=950018&r2=950019&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Tue Jun 1 11:12:40 2010
@@ -205,20 +205,10 @@ ${item.description}</span>
<#macro renderIgnoredField></#macro>
-<#macro renderFieldTitle style title fieldHelpText="">
- <#if fieldHelpText?has_content>
- <span title="${fieldHelpText}"><#t/>
- </#if>
- <#if style?has_content>
- <span class="${style}"><#t/>
- </#if>
+<#macro renderFieldTitle style title id fieldHelpText="">
+ <span<#if fieldHelpText?has_content> title="${fieldHelpText}"</#if><#if style?has_content> class="${style}"</#if><#if id?has_content> id="${id}"</#if>><#t/>
${title}<#t/>
- <#if style?has_content>
- </span><#t/>
- </#if>
- <#if fieldHelpText?has_content>
- </span><#t/>
- </#if>
+ </span><#t/>
</#macro>
<#macro renderSingleFormFieldTitle></#macro>
Modified: ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl?rev=950019&r1=950018&r2=950019&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl Tue Jun 1 11:12:40 2010
@@ -50,7 +50,7 @@ under the License.
<#macro renderHiddenField name value id event action></#macro>
<#macro renderIgnoredField></#macro>
-<#macro renderFieldTitle style title fieldHelpText=""><@renderField title /></#macro>
+<#macro renderFieldTitle style title id fieldHelpText=""><@renderField title /></#macro>
<#macro renderSingleFormFieldTitle></#macro>
<#macro renderFormOpen linkUrl formType targetWindow containerId containerStyle autocomplete name useRowSubmit></#macro>
Modified: ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl?rev=950019&r1=950018&r2=950019&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl Tue Jun 1 11:12:40 2010
@@ -58,7 +58,7 @@ under the License.
<#macro renderHiddenField name value id event action></#macro>
<#macro renderIgnoredField></#macro>
-<#macro renderFieldTitle style title fieldHelpText=""></#macro>
+<#macro renderFieldTitle style title id fieldHelpText=""></#macro>
<#macro renderSingleFormFieldTitle title></#macro>
<#macro renderFormOpen linkUrl formType targetWindow containerId containerStyle autocomplete name useRowSubmit></#macro>