Author: nmalin
Date: Thu Sep 26 15:36:18 2019
New Revision: 1867584

URL: http://svn.apache.org/viewvc?rev=1867584&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/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java

Modified: 
ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java?rev=1867584&r1=1867583&r2=1867584&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
 (original)
+++ 
ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
 Thu Sep 26 15:36:18 2019
@@ -1089,14 +1089,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


Reply via email to