Author: jacopoc
Date: Thu Jul 9 09:20:07 2009 New Revision: 792470 URL: http://svn.apache.org/viewvc?rev=792470&view=rev Log: Fixed issues with new renderers when a link was inserted in the form title. Thanks to Divesh Dutta for the bug report and partial fix. Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java 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=792470&r1=792469&r2=792470&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 Thu Jul 9 09:20:07 2009 @@ -2448,8 +2448,17 @@ if (UtilValidate.isNotEmpty(targetBuffer.toString()) && targetBuffer.toString().toLowerCase().startsWith("javascript:")) { targetType="plain"; } - //FIXME need to change to macro - WidgetWorker.makeHyperlinkString(writer, modelFormField.getHeaderLinkStyle(), targetType, targetBuffer.toString(), null, titleText, modelFormField, this.request, this.response, null, null); + StringWriter sr = new StringWriter(); + WidgetWorker.makeHyperlinkString(sr, modelFormField.getHeaderLinkStyle(), targetType, targetBuffer.toString(), null, titleText, modelFormField, this.request, this.response, null, null); + String title = sr.toString().replace("\"", "\'"); + sr = new StringWriter(); + sr.append("<@renderHyperlinkTitle "); + sr.append(" name=\""); + sr.append(modelFormField.getModelForm().getName()); + sr.append("\" title=\""); + sr.append(title); + sr.append("\" />"); + executeMacro(sr.toString()); } else if (modelFormField.isSortField()) { renderSortField (writer, context, modelFormField, titleText); } else if (modelFormField.isRowSubmit()) { @@ -2459,7 +2468,7 @@ sr.append(modelFormField.getModelForm().getName()); sr.append("\" title=\""); sr.append(titleText); - sr.append("\" />"); + sr.append("\" showSelectAll=\"Y\"/>"); executeMacro(sr.toString()); } else { writer.append(titleText); Modified: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=792470&r1=792469&r2=792470&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl (original) +++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Thu Jul 9 09:20:07 2009 @@ -128,7 +128,7 @@ <#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId collapsible expandToolTip collapseToolTip></#macro> <#macro renderFieldGroupClose style id title></#macro> -<#macro renderHyperlinkTitle name title></#macro> +<#macro renderHyperlinkTitle name title showSelectAll="N"></#macro> <#macro renderSortField style title linkUrl ajaxEnabled></#macro> <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro> <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description><@renderField description /></#macro> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=792470&r1=792469&r2=792470&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original) +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Thu Jul 9 09:20:07 2009 @@ -453,7 +453,7 @@ </#macro> <#macro renderFieldGroupClose style id title><#if style?has_content || id?has_content || title?has_content></div></div></#if></#macro> -<#macro renderHyperlinkTitle name title><#if title?has_content>${title}<br/></#if><input type="checkbox" name="selectAll" value="Y" onclick="javascript:toggleAll(this, '${name}');"/></#macro> +<#macro renderHyperlinkTitle name title showSelectAll="N"><#if title?has_content>${title}<br/></#if><#if showSelectAll="Y"><input type="checkbox" name="selectAll" value="Y" onclick="javascript:toggleAll(this, '${name}');"/></#if></#macro> <#macro renderSortField style title linkUrl ajaxEnabled><a<#if style?has_content> class="${style}"</#if> href="<#if ajaxEnabled?has_content && ajaxEnabled>javascript:ajaxUpdateAreas('${linkUrl}')<#else>${linkUrl}</#if>">${title}</a></#macro> <#macro formatBoundaryComment boundaryType widgetType widgetName><!-- ${boundaryType} ${widgetType} ${widgetName} --></#macro> Modified: ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl?rev=792470&r1=792469&r2=792470&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl (original) +++ ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl Thu Jul 9 09:20:07 2009 @@ -17,7 +17,7 @@ under the License. --> -<#macro renderField text><#if text?exists>${text}</#if></#macro> +<#macro renderField text><#if text?exists>"${text}"</#if></#macro> <#macro renderDisplayField idName description class alert inPlaceEditorId="" inPlaceEditorUrl="" inPlaceEditorParams=""> <@renderField description /> @@ -112,7 +112,7 @@ <#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId collapsible expandToolTip collapseToolTip></#macro> <#macro renderFieldGroupClose style id title></#macro> -<#macro renderHyperlinkTitle name title></#macro> +<#macro renderHyperlinkTitle name title showSelectAll="N"></#macro> <#macro renderSortField style title linkUrl ajaxEnabled></#macro> <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro> <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description><@renderField description /></#macro> Modified: ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl?rev=792470&r1=792469&r2=792470&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl (original) +++ ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl Thu Jul 9 09:20:07 2009 @@ -110,7 +110,7 @@ <#macro renderFieldGroupOpen style id title collapsed collapsibleAreaId collapsible expandToolTip collapseToolTip></#macro> <#macro renderFieldGroupClose style id title></#macro> -<#macro renderHyperlinkTitle name title></#macro> +<#macro renderHyperlinkTitle name title showSelectAll="N"></#macro> <#macro renderSortField style title linkUrl ajaxEnabled></#macro> <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro> <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description><@renderField description /></#macro> |
Free forum by Nabble | Edit this page |