You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/06/18 09:58:25 UTC

svn commit: r1494057 - in /ofbiz/trunk/framework/widget: dtd/ src/org/ofbiz/widget/form/ templates/

Author: adrianc
Date: Tue Jun 18 07:58:25 2013
New Revision: 1494057

URL: http://svn.apache.org/r1494057
Log:
Form widget sort field improvement - add the ability to specify help text on column headers.

Modified:
    ofbiz/trunk/framework/widget/dtd/widget-form.xsd
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.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/dtd/widget-form.xsd
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=1494057&r1=1494056&r2=1494057&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original)
+++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Tue Jun 18 07:58:25 2013
@@ -628,6 +628,12 @@ under the License.
                 </xs:documentation>
                 </xs:annotation>
             </xs:attribute>
+            <xs:attribute type="xs:string" name="sort-field-help-text">
+                <xs:annotation>
+                    <xs:documentation>Help text to be displayed when the mouse hovers over the column heading.
+                </xs:documentation>
+                </xs:annotation>
+            </xs:attribute>
             <xs:attribute type="xs:string" name="sort-field-asc-style">
                 <xs:annotation>
                     <xs:documentation>The name of a style (like a CSS class) to apply to the sort field link ordered ascending.

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=1494057&r1=1494056&r2=1494057&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 18 07:58:25 2013
@@ -2751,6 +2751,10 @@ public class MacroFormRenderer implement
         sr.append(linkUrl);
         sr.append("\" ajaxEnabled=");
         sr.append(Boolean.toString(ajaxEnabled));
+        String tooltip = modelFormField.getSortFieldHelpText(context);
+        if (!tooltip.isEmpty()) {
+            sr.append(" tooltip=\"").append(tooltip).append("\"");
+        }
         sr.append(" />");
         executeMacro(writer, sr.toString());
     }

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1494057&r1=1494056&r2=1494057&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Tue Jun 18 07:58:25 2013
@@ -114,6 +114,7 @@ public class ModelFormField {
     protected boolean separateColumn = false;
     protected Boolean requiredField = null;
     protected Boolean sortField = null;
+    protected String sortFieldHelpText;
     protected String headerLink;
     protected String headerLinkStyle;
 
@@ -123,7 +124,7 @@ public class ModelFormField {
     protected List<UpdateArea> onClickUpdateAreas;
 
     // ===== CONSTRUCTORS =====
-    /** Default Constructor */
+    /** Copy Constructor */
     public ModelFormField(ModelForm modelForm) {
         this.modelForm = modelForm;
     }
@@ -159,6 +160,7 @@ public class ModelFormField {
         this.separateColumn = "true".equals(fieldElement.getAttribute("separate-column"));
         this.requiredField = fieldElement.hasAttribute("required-field") ? "true".equals(fieldElement.getAttribute("required-field")) : null;
         this.sortField = fieldElement.hasAttribute("sort-field") ? "true".equals(fieldElement.getAttribute("sort-field")) : null;
+        this.sortFieldHelpText = fieldElement.getAttribute("sort-field-help-text");
         this.headerLink = fieldElement.getAttribute("header-link");
         this.headerLinkStyle = fieldElement.getAttribute("header-link-style");
 
@@ -242,6 +244,7 @@ public class ModelFormField {
         if (UtilValidate.isNotEmpty(overrideFormField.tooltip)) this.tooltip = overrideFormField.tooltip;
         if (overrideFormField.requiredField != null) this.requiredField = overrideFormField.requiredField;
         if (overrideFormField.sortField != null) this.sortField = overrideFormField.sortField;
+        if (!overrideFormField.sortFieldHelpText.isEmpty()) this.sortFieldHelpText = overrideFormField.sortFieldHelpText;
         if (UtilValidate.isNotEmpty(overrideFormField.titleAreaStyle)) this.titleAreaStyle = overrideFormField.titleAreaStyle;
         if (UtilValidate.isNotEmpty(overrideFormField.widgetAreaStyle)) this.widgetAreaStyle = overrideFormField.widgetAreaStyle;
         if (UtilValidate.isNotEmpty(overrideFormField.titleStyle)) this.titleStyle = overrideFormField.titleStyle;
@@ -1243,6 +1246,10 @@ public class ModelFormField {
         this.requiredField = required;
     }
 
+    public String getSortFieldHelpText(Map<String, Object> context) {
+        return FlexibleStringExpander.expandString(this.sortFieldHelpText, context);
+    }
+
     public boolean isSortField() {
         return this.sortField != null && this.sortField.booleanValue();
     }

Modified: ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl Tue Jun 18 07:58:25 2013
@@ -113,7 +113,7 @@ under the License.
 <#macro renderFieldGroupClose style id title></#macro>
 
 <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
-<#macro renderSortField style title linkUrl ajaxEnabled><@renderFieldTitle style title /></#macro>
+<#macro renderSortField style title linkUrl ajaxEnabled tooltip=""><@renderFieldTitle style title /></#macro>
 <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
 <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description><@renderField description /></#macro>
 <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title alternate linkUrl targetWindow description confirmation><@renderField description />,<#rt/></#macro>

Modified: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Tue Jun 18 07:58:25 2013
@@ -133,7 +133,7 @@ under the License.
 <#macro renderFieldGroupClose style id title></#macro>
 
 <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
-<#macro renderSortField style title linkUrl ajaxEnabled><@renderFieldTitle style title /></#macro>
+<#macro renderSortField style title linkUrl ajaxEnabled tooltip=""><@renderFieldTitle style title /></#macro>
 <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
 <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description><@renderField description /></#macro>
 <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title alternate linkUrl targetWindow description confirmation><@makeBlock linkStyle description /></#macro>

Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Tue Jun 18 07:58:25 2013
@@ -811,9 +811,11 @@ Parameter: lastViewName, String, optiona
   <#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 renderSortField style title linkUrl ajaxEnabled tooltip="">
+  <a<#if style?has_content> class="${style}"</#if> href="<#if ajaxEnabled?has_content && ajaxEnabled>javascript:ajaxUpdateAreas('${linkUrl}')<#else>${linkUrl}</#if>"<#if tooltip?has_content> title="${tooltip}"</#if>>${title}</a>
 </#macro>
+
 <#macro formatBoundaryComment boundaryType widgetType widgetName><!-- ${boundaryType}  ${widgetType}  ${widgetName} --></#macro>
 
 <#macro renderTooltip tooltip tooltipStyle>

Modified: ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl Tue Jun 18 07:58:25 2013
@@ -113,7 +113,7 @@ under the License.
 <#macro renderFieldGroupClose style id title></#macro>
 
 <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
-<#macro renderSortField style title linkUrl ajaxEnabled><@renderFieldTitle style title /></#macro>
+<#macro renderSortField style title linkUrl ajaxEnabled tooltip=""><@renderFieldTitle style title /></#macro>
 <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
 <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description><@renderField description /></#macro>
 <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc alternate linkUrl targetWindow description><@renderField description /></#macro>
\ No newline at end of file

Modified: ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl (original)
+++ ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl Tue Jun 18 07:58:25 2013
@@ -106,7 +106,7 @@ under the License.
 <#macro renderFieldGroupClose style id title></#macro>
 
 <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
-<#macro renderSortField style title linkUrl ajaxEnabled></#macro>
+<#macro renderSortField style title linkUrl ajaxEnabled tooltip=""></#macro>
 <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
 <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action imgSrc description confirmation><@renderField description /></#macro>
 <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc title alternate linkUrl targetWindow description confirmation><@renderField description /></#macro>



Re: svn commit: r1494057 - in /ofbiz/trunk/framework/widget: dtd/ src/org/ofbiz/widget/form/ templates/

Posted by Adrian Crum <ad...@sandglass-software.com>.
Fixed in revision 1494668. Thanks!

-Adrian

On 6/19/2013 4:13 PM, Ankit Jain wrote:
> Hi Adrian,
>
> This commit breaks some of the Forms.
>
> https://demo-trunk.ofbiz.apache.org/accounting/control/EditAgreement
>
> Inline
> suggestion
> .
>
>
> Thanks &
> Regards,
> *____*____________
>   Ankit Jain | 9717930151
>
>
> On Tue, Jun 18, 2013 at 1:28 PM, <ad...@apache.org> wrote:
>
>> Author: adrianc
>> Date: Tue Jun 18 07:58:25 2013
>> New Revision: 1494057
>>
>> URL: http://svn.apache.org/r1494057
>> Log:
>> Form widget sort field improvement - add the ability to specify help text
>> on column headers.
>>
>> Modified:
>>      ofbiz/trunk/framework/widget/dtd/widget-form.xsd
>>      ofbiz
>> /trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
>>      ofbiz
>> /trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.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/dtd/widget-form.xsd
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=1494057&r1=1494056&r2=1494057&view=diff
>>
>> ==============================================================================
>> --- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original)
>> +++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Tue Jun 18 07:58:25
>> 2013
>> @@ -628,6 +628,12 @@ under the License.
>>                   </xs:documentation>
>>                   </xs:annotation>
>>               </xs:attribute>
>> +            <xs:attribute type="xs:string" name="sort-field-help-text">
>> +                <xs:annotation>
>> +                    <xs:documentation>Help text to be displayed when the
>> mouse hovers over the column heading.
>> +                </xs:documentation>
>> +                </xs:annotation>
>> +            </xs:attribute>
>>               <xs:attribute type="xs:string" name="sort-field-asc-style">
>>                   <xs:annotation>
>>                       <xs:documentation>The name of a style (like a CSS
>> class) to apply to the sort field link ordered ascending.
>>
>> 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=1494057&r1=1494056&r2=1494057&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 18 07:58:25 2013
>> @@ -2751,6 +2751,10 @@ public class MacroFormRenderer implement
>>           sr.append(linkUrl);
>>           sr.append("\" ajaxEnabled=");
>>           sr.append(Boolean.toString(ajaxEnabled));
>> +        String tooltip = modelFormField.getSortFieldHelpText(context);
>> +        if (!tooltip.isEmpty()) {
>> +            sr.append(" tooltip=\"").append(tooltip).append("\"");
>> +        }
>>           sr.append(" />");
>>           executeMacro(writer, sr.toString());
>>       }
>>
>> Modified:
>> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1494057&r1=1494056&r2=1494057&view=diff
>>
>> ==============================================================================
>> ---
>> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
>> (original)
>> +++
>> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
>> Tue Jun 18 07:58:25 2013
>> @@ -114,6 +114,7 @@ public class ModelFormField {
>>       protected boolean separateColumn = false;
>>       protected Boolean requiredField = null;
>>       protected Boolean sortField = null;
>> +    protected String sortFieldHelpText;
>>       protected String headerLink;
>>       protected String headerLinkStyle;
>>
>> @@ -123,7 +124,7 @@ public class ModelFormField {
>>       protected List<UpdateArea> onClickUpdateAreas;
>>
>>       // ===== CONSTRUCTORS =====
>> -    /** Default Constructor */
>> +    /** Copy Constructor */
>>       public ModelFormField(ModelForm modelForm) {
>>           this.modelForm = modelForm;
>>       }
>> @@ -159,6 +160,7 @@ public class ModelFormField {
>>           this.separateColumn =
>> "true".equals(fieldElement.getAttribute("separate-column"));
>>           this.requiredField = fieldElement.hasAttribute("required-field")
>> ? "true".equals(fieldElement.getAttribute("required-field")) : null;
>>           this.sortField = fieldElement.hasAttribute("sort-field") ?
>> "true".equals(fieldElement.getAttribute("sort-field")) : null;
>> +        this.sortFieldHelpText =
>> fieldElement.getAttribute("sort-field-help-text");
>>           this.headerLink = fieldElement.getAttribute("header-link");
>>           this.headerLinkStyle =
>> fieldElement.getAttribute("header-link-style");
>>
>> @@ -242,6 +244,7 @@ public class ModelFormField {
>>           if (UtilValidate.isNotEmpty(overrideFormField.tooltip))
>> this.tooltip = overrideFormField.tooltip;
>>           if (overrideFormField.requiredField != null) this.requiredField =
>> overrideFormField.requiredField;
>>           if (overrideFormField.sortField != null) this.sortField =
>> overrideFormField.sortField;
>> +        if (!
>> overrideFormField.sortFieldHelpText.isEmpty()) this.sortFieldHelpText =
>> overrideFormField.sortFieldHelpText;
>>
>>> null check for "
> overrideFormField.sortFieldHelpText" is missing here thats why its throwing
> error.
> UtilValidate.isNotEmpty() will solve the problem and checks for both null &
> empty.
>
>           if (
>> UtilValidate.isNotEmpty(overrideFormField.titleAreaStyle))
>> this.titleAreaStyle = overrideFormField.titleAreaStyle;
>>           if (UtilValidate.isNotEmpty(overrideFormField.widgetAreaStyle))
>> this.widgetAreaStyle = overrideFormField.widgetAreaStyle;
>>           if (UtilValidate.isNotEmpty(overrideFormField.titleStyle))
>> this.titleStyle = overrideFormField.titleStyle;
>> @@ -1243,6 +1246,10 @@ public class ModelFormField {
>>           this.requiredField = required;
>>       }
>>
>> +    public String getSortFieldHelpText(Map<String, Object> context) {
>> +        return
>> FlexibleStringExpander.expandString(this.sortFieldHelpText, context);
>> +    }
>> +
>>       public boolean isSortField() {
>>           return this.sortField != null && this.sortField.booleanValue();
>>       }
>>
>> Modified: ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>>
>> ==============================================================================
>> --- ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
>> (original)
>> +++ ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl Tue Jun
>> 18 07:58:25 2013
>> @@ -113,7 +113,7 @@ under the License.
>>   <#macro renderFieldGroupClose style id title></#macro>
>>
>>   <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
>> -<#macro renderSortField style title linkUrl
>> ajaxEnabled><@renderFieldTitle style title /></#macro>
>> +<#macro renderSortField style title linkUrl ajaxEnabled
>> tooltip=""><@renderFieldTitle style title /></#macro>
>>   <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
>>   <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action
>> imgSrc description><@renderField description /></#macro>
>>   <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc
>> title alternate linkUrl targetWindow description confirmation><@renderField
>> description />,<#rt/></#macro>
>>
>> Modified: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>>
>> ==============================================================================
>> --- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
>> (original)
>> +++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Tue Jun
>> 18 07:58:25 2013
>> @@ -133,7 +133,7 @@ under the License.
>>   <#macro renderFieldGroupClose style id title></#macro>
>>
>>   <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
>> -<#macro renderSortField style title linkUrl
>> ajaxEnabled><@renderFieldTitle style title /></#macro>
>> +<#macro renderSortField style title linkUrl ajaxEnabled
>> tooltip=""><@renderFieldTitle style title /></#macro>
>>   <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
>>   <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action
>> imgSrc description><@renderField description /></#macro>
>>   <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc
>> title alternate linkUrl targetWindow description confirmation><@makeBlock
>> linkStyle description /></#macro>
>>
>> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>>
>> ==============================================================================
>> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
>> (original)
>> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Tue
>> Jun 18 07:58:25 2013
>> @@ -811,9 +811,11 @@ Parameter: lastViewName, String, optiona
>>     <#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 renderSortField style title linkUrl ajaxEnabled tooltip="">
>> +  <a<#if style?has_content> class="${style}"</#if> href="<#if
>> ajaxEnabled?has_content &&
>> ajaxEnabled>javascript:ajaxUpdateAreas('${linkUrl}')<#else>${linkUrl}</#if>"<#if
>> tooltip?has_content> title="${tooltip}"</#if>>${title}</a>
>>   </#macro>
>> +
>>   <#macro formatBoundaryComment boundaryType widgetType widgetName><!--
>> ${boundaryType}  ${widgetType}  ${widgetName} --></#macro>
>>
>>   <#macro renderTooltip tooltip tooltipStyle>
>>
>> Modified: ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>>
>> ==============================================================================
>> --- ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
>> (original)
>> +++ ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl Tue
>> Jun 18 07:58:25 2013
>> @@ -113,7 +113,7 @@ under the License.
>>   <#macro renderFieldGroupClose style id title></#macro>
>>
>>   <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
>> -<#macro renderSortField style title linkUrl
>> ajaxEnabled><@renderFieldTitle style title /></#macro>
>> +<#macro renderSortField style title linkUrl ajaxEnabled
>> tooltip=""><@renderFieldTitle style title /></#macro>
>>   <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
>>   <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action
>> imgSrc description><@renderField description /></#macro>
>>   <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc
>> alternate linkUrl targetWindow description><@renderField description
>> /></#macro>
>> \ No newline at end of file
>>
>> Modified: ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>>
>> ==============================================================================
>> --- ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
>> (original)
>> +++ ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl Tue Jun
>> 18 07:58:25 2013
>> @@ -106,7 +106,7 @@ under the License.
>>   <#macro renderFieldGroupClose style id title></#macro>
>>
>>   <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
>> -<#macro renderSortField style title linkUrl ajaxEnabled></#macro>
>> +<#macro renderSortField style title linkUrl ajaxEnabled
>> tooltip=""></#macro>
>>   <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
>>   <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action
>> imgSrc description confirmation><@renderField description /></#macro>
>>   <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc
>> title alternate linkUrl targetWindow description confirmation><@renderField
>> description /></#macro>
>>
>>
>>


Re: svn commit: r1494057 - in /ofbiz/trunk/framework/widget: dtd/ src/org/ofbiz/widget/form/ templates/

Posted by Adrian Crum <ad...@sandglass-software.com>.
On 6/19/2013 4:13 PM, Ankit Jain wrote:
> Ankit Jain


Re: svn commit: r1494057 - in /ofbiz/trunk/framework/widget: dtd/ src/org/ofbiz/widget/form/ templates/

Posted by Ankit Jain <an...@gmail.com>.
Hi Adrian,

This commit breaks some of the Forms.

https://demo-trunk.ofbiz.apache.org/accounting/control/EditAgreement

Inline
suggestion
.


Thanks &
Regards,
*____*____________
 Ankit Jain | 9717930151


On Tue, Jun 18, 2013 at 1:28 PM, <ad...@apache.org> wrote:

> Author: adrianc
> Date: Tue Jun 18 07:58:25 2013
> New Revision: 1494057
>
> URL: http://svn.apache.org/r1494057
> Log:
> Form widget sort field improvement - add the ability to specify help text
> on column headers.
>
> Modified:
>     ofbiz/trunk/framework/widget/dtd/widget-form.xsd
>     ofbiz
> /trunk/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
>     ofbiz
> /trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.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/dtd/widget-form.xsd
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=1494057&r1=1494056&r2=1494057&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original)
> +++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Tue Jun 18 07:58:25
> 2013
> @@ -628,6 +628,12 @@ under the License.
>                  </xs:documentation>
>                  </xs:annotation>
>              </xs:attribute>
> +            <xs:attribute type="xs:string" name="sort-field-help-text">
> +                <xs:annotation>
> +                    <xs:documentation>Help text to be displayed when the
> mouse hovers over the column heading.
> +                </xs:documentation>
> +                </xs:annotation>
> +            </xs:attribute>
>              <xs:attribute type="xs:string" name="sort-field-asc-style">
>                  <xs:annotation>
>                      <xs:documentation>The name of a style (like a CSS
> class) to apply to the sort field link ordered ascending.
>
> 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=1494057&r1=1494056&r2=1494057&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 18 07:58:25 2013
> @@ -2751,6 +2751,10 @@ public class MacroFormRenderer implement
>          sr.append(linkUrl);
>          sr.append("\" ajaxEnabled=");
>          sr.append(Boolean.toString(ajaxEnabled));
> +        String tooltip = modelFormField.getSortFieldHelpText(context);
> +        if (!tooltip.isEmpty()) {
> +            sr.append(" tooltip=\"").append(tooltip).append("\"");
> +        }
>          sr.append(" />");
>          executeMacro(writer, sr.toString());
>      }
>
> Modified:
> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=1494057&r1=1494056&r2=1494057&view=diff
>
> ==============================================================================
> ---
> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
> (original)
> +++
> ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
> Tue Jun 18 07:58:25 2013
> @@ -114,6 +114,7 @@ public class ModelFormField {
>      protected boolean separateColumn = false;
>      protected Boolean requiredField = null;
>      protected Boolean sortField = null;
> +    protected String sortFieldHelpText;
>      protected String headerLink;
>      protected String headerLinkStyle;
>
> @@ -123,7 +124,7 @@ public class ModelFormField {
>      protected List<UpdateArea> onClickUpdateAreas;
>
>      // ===== CONSTRUCTORS =====
> -    /** Default Constructor */
> +    /** Copy Constructor */
>      public ModelFormField(ModelForm modelForm) {
>          this.modelForm = modelForm;
>      }
> @@ -159,6 +160,7 @@ public class ModelFormField {
>          this.separateColumn =
> "true".equals(fieldElement.getAttribute("separate-column"));
>          this.requiredField = fieldElement.hasAttribute("required-field")
> ? "true".equals(fieldElement.getAttribute("required-field")) : null;
>          this.sortField = fieldElement.hasAttribute("sort-field") ?
> "true".equals(fieldElement.getAttribute("sort-field")) : null;
> +        this.sortFieldHelpText =
> fieldElement.getAttribute("sort-field-help-text");
>          this.headerLink = fieldElement.getAttribute("header-link");
>          this.headerLinkStyle =
> fieldElement.getAttribute("header-link-style");
>
> @@ -242,6 +244,7 @@ public class ModelFormField {
>          if (UtilValidate.isNotEmpty(overrideFormField.tooltip))
> this.tooltip = overrideFormField.tooltip;
>          if (overrideFormField.requiredField != null) this.requiredField =
> overrideFormField.requiredField;
>          if (overrideFormField.sortField != null) this.sortField =
> overrideFormField.sortField;
> +        if (!
> overrideFormField.sortFieldHelpText.isEmpty()) this.sortFieldHelpText =
> overrideFormField.sortFieldHelpText;
>

>> null check for "
overrideFormField.sortFieldHelpText" is missing here thats why its throwing
error.
UtilValidate.isNotEmpty() will solve the problem and checks for both null &
empty.

         if (
> UtilValidate.isNotEmpty(overrideFormField.titleAreaStyle))
> this.titleAreaStyle = overrideFormField.titleAreaStyle;
>          if (UtilValidate.isNotEmpty(overrideFormField.widgetAreaStyle))
> this.widgetAreaStyle = overrideFormField.widgetAreaStyle;
>          if (UtilValidate.isNotEmpty(overrideFormField.titleStyle))
> this.titleStyle = overrideFormField.titleStyle;
> @@ -1243,6 +1246,10 @@ public class ModelFormField {
>          this.requiredField = required;
>      }
>
> +    public String getSortFieldHelpText(Map<String, Object> context) {
> +        return
> FlexibleStringExpander.expandString(this.sortFieldHelpText, context);
> +    }
> +
>      public boolean isSortField() {
>          return this.sortField != null && this.sortField.booleanValue();
>      }
>
> Modified: ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl
> (original)
> +++ ofbiz/trunk/framework/widget/templates/csvFormMacroLibrary.ftl Tue Jun
> 18 07:58:25 2013
> @@ -113,7 +113,7 @@ under the License.
>  <#macro renderFieldGroupClose style id title></#macro>
>
>  <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
> -<#macro renderSortField style title linkUrl
> ajaxEnabled><@renderFieldTitle style title /></#macro>
> +<#macro renderSortField style title linkUrl ajaxEnabled
> tooltip=""><@renderFieldTitle style title /></#macro>
>  <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
>  <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action
> imgSrc description><@renderField description /></#macro>
>  <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc
> title alternate linkUrl targetWindow description confirmation><@renderField
> description />,<#rt/></#macro>
>
> Modified: ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl
> (original)
> +++ ofbiz/trunk/framework/widget/templates/foFormMacroLibrary.ftl Tue Jun
> 18 07:58:25 2013
> @@ -133,7 +133,7 @@ under the License.
>  <#macro renderFieldGroupClose style id title></#macro>
>
>  <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
> -<#macro renderSortField style title linkUrl
> ajaxEnabled><@renderFieldTitle style title /></#macro>
> +<#macro renderSortField style title linkUrl ajaxEnabled
> tooltip=""><@renderFieldTitle style title /></#macro>
>  <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
>  <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action
> imgSrc description><@renderField description /></#macro>
>  <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc
> title alternate linkUrl targetWindow description confirmation><@makeBlock
> linkStyle description /></#macro>
>
> Modified: ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl
> (original)
> +++ ofbiz/trunk/framework/widget/templates/htmlFormMacroLibrary.ftl Tue
> Jun 18 07:58:25 2013
> @@ -811,9 +811,11 @@ Parameter: lastViewName, String, optiona
>    <#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 renderSortField style title linkUrl ajaxEnabled tooltip="">
> +  <a<#if style?has_content> class="${style}"</#if> href="<#if
> ajaxEnabled?has_content &&
> ajaxEnabled>javascript:ajaxUpdateAreas('${linkUrl}')<#else>${linkUrl}</#if>"<#if
> tooltip?has_content> title="${tooltip}"</#if>>${title}</a>
>  </#macro>
> +
>  <#macro formatBoundaryComment boundaryType widgetType widgetName><!--
> ${boundaryType}  ${widgetType}  ${widgetName} --></#macro>
>
>  <#macro renderTooltip tooltip tooltipStyle>
>
> Modified: ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl
> (original)
> +++ ofbiz/trunk/framework/widget/templates/textFormMacroLibrary.ftl Tue
> Jun 18 07:58:25 2013
> @@ -113,7 +113,7 @@ under the License.
>  <#macro renderFieldGroupClose style id title></#macro>
>
>  <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
> -<#macro renderSortField style title linkUrl
> ajaxEnabled><@renderFieldTitle style title /></#macro>
> +<#macro renderSortField style title linkUrl ajaxEnabled
> tooltip=""><@renderFieldTitle style title /></#macro>
>  <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
>  <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action
> imgSrc description><@renderField description /></#macro>
>  <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc
> alternate linkUrl targetWindow description><@renderField description
> /></#macro>
> \ No newline at end of file
>
> Modified: ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl?rev=1494057&r1=1494056&r2=1494057&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl
> (original)
> +++ ofbiz/trunk/framework/widget/templates/xmlFormMacroLibrary.ftl Tue Jun
> 18 07:58:25 2013
> @@ -106,7 +106,7 @@ under the License.
>  <#macro renderFieldGroupClose style id title></#macro>
>
>  <#macro renderHyperlinkTitle name title showSelectAll="N"></#macro>
> -<#macro renderSortField style title linkUrl ajaxEnabled></#macro>
> +<#macro renderSortField style title linkUrl ajaxEnabled
> tooltip=""></#macro>
>  <#macro formatBoundaryComment boundaryType widgetType widgetName></#macro>
>  <#macro makeHiddenFormLinkAnchor linkStyle hiddenFormName event action
> imgSrc description confirmation><@renderField description /></#macro>
>  <#macro makeHyperlinkString linkStyle hiddenFormName event action imgSrc
> title alternate linkUrl targetWindow description confirmation><@renderField
> description /></#macro>
>
>
>