Skip to content
Permalink
Browse files

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.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1867582 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
nmalin committed Sep 26, 2019
1 parent 5317938 commit 2132b9e60c9e73bcec790e76f0189cc47ef7d366
@@ -1149,14 +1149,14 @@ public DateFindField(Element element, ModelFormField 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

0 comments on commit 2132b9e

Please sign in to comment.
You can’t perform that action at this time.