You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2019/09/26 15:31:46 UTC

svn commit: r1867583 - /ofbiz/ofbiz-framework/branches/release18.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java

Author: nmalin
Date: Thu Sep 26 15:31:46 2019
New Revision: 1867583

URL: http://svn.apache.org/viewvc?rev=1867583&view=rev
Log:
Fixed: Default option for ModelFormField.DateFindField doesn't work
(OFBIZ-11212)
When you use a date-find element on form, the defaut option are in code like to greater_than and less _than

        public DateFindField(int fieldSource, String type) {
            super(fieldSource, type);
            this.defaultOptionFrom = greaterThanEqualTo;
            this.defaultOptionThru = lessThanEqualTo;
        }

but on macro

<#macro renderDateFindField ...
      <option value=greaterThan<#if defaultOptionFrom==greaterThan> selected=selected</#if>></option><#rt/>
      ...
      <option value=opLessThan<#if defaultOptionThru==opLessThan> selected=selected</#if>></option><#rt/>
      ...
</#macro>

So the value java isn't correct with ftl values and default value never used.

Modified:
    ofbiz/ofbiz-framework/branches/release18.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java

Modified: ofbiz/ofbiz-framework/branches/release18.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java?rev=1867583&r1=1867582&r2=1867583&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/branches/release18.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java (original)
+++ ofbiz/ofbiz-framework/branches/release18.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java Thu Sep 26 15:31:46 2019
@@ -1114,14 +1114,14 @@ public class ModelFormField {
 
         public DateFindField(int fieldSource, ModelFormField modelFormField) {
             super(fieldSource, modelFormField);
-            this.defaultOptionFrom = "greaterThanEqualTo";
-            this.defaultOptionThru = "lessThanEqualTo";
+            this.defaultOptionFrom = "greaterThan";
+            this.defaultOptionThru = "opLessThan";
         }
 
         public DateFindField(int fieldSource, String type) {
             super(fieldSource, type);
-            this.defaultOptionFrom = "greaterThanEqualTo";
-            this.defaultOptionThru = "lessThanEqualTo";
+            this.defaultOptionFrom = "greaterThan";
+            this.defaultOptionThru = "opLessThan";
         }
 
         @Override