Author: jleroux
Date: Tue Mar 11 10:49:31 2014
New Revision: 1576276
URL: http://svn.apache.org/r1576276
Log:
With https://issues.apache.org/jira/browse/OFBIZ-64 the default option for
text-find fields was like (aka begins with, don't ask why)
Then with https://issues.apache.org/jira/browse/OFBIZ-3128 contains became the
default
But this was working only when defining a text-field. When auto-fields-entity
(and I guess auto-fields-service, not tested) was used then like/begins-with
was still the default.
This commit changes that and makes things consistent: contains is now always
used and set as default everywhere (no longer need to specify the text-field
when using auto-fields-* to have contains as default)
Note: I'm not quite sure why like/begins-with was still used as default, since
it was no longer the default in widget-form.xsd, but anyway making contains
default there works. Also in ModelFormField.java to have things consistent
Modified:
ofbiz/trunk/applications/humanres/widget/forms/RecruitmentForms.xml
ofbiz/trunk/framework/widget/dtd/widget-form.xsd
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
Modified: ofbiz/trunk/applications/humanres/widget/forms/RecruitmentForms.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/widget/forms/RecruitmentForms.xml?rev=1576276&r1=1576275&r2=1576276&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/widget/forms/RecruitmentForms.xml
(original)
+++ ofbiz/trunk/applications/humanres/widget/forms/RecruitmentForms.xml Tue Mar
11 10:49:31 2014
@@ -228,7 +228,6 @@ under the License.
</form>
<form name="FindJobInterview" type="single" target="FindJobInterview">
<auto-fields-entity entity-name="JobInterview"
default-field-type="find"/>
- <field name="jobInterviewId"><text-find ignore-case="true"/></field>
<field name="noConditionFind"><hidden value="Y"/></field>
<field name="jobIntervieweePartyId"><lookup
target-form-name="LookupPartyName"/></field>
<field name="jobRequisitionId"><lookup
target-form-name="LookupJobRequisition"/></field>
Modified: ofbiz/trunk/framework/widget/dtd/widget-form.xsd
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=1576276&r1=1576275&r2=1576276&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original)
+++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Tue Mar 11 10:49:31 2014
@@ -1444,11 +1444,11 @@ under the License.
</xs:restriction>
</xs:simpleType>
</xs:attribute>
- <xs:attribute name="default-option">
+ <xs:attribute name="default-option" default="contains">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="equals" />
- <xs:enumeration value="like" />
+ <xs:enumeration value="like" /><!-- this is actually
"begins with" -->
<xs:enumeration value="contains" />
<xs:enumeration value="empty" />
<xs:enumeration value="notEqual" />
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=1576276&r1=1576275&r2=1576276&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 Mar 11 10:49:31 2014
@@ -3463,7 +3463,7 @@ public class ModelFormField {
public static class TextFindField extends TextField {
protected boolean ignoreCase = true;
protected boolean hideIgnoreCase = false;
- protected String defaultOption = "like";
+ protected String defaultOption = "contains";
protected boolean hideOptions = false;
public TextFindField(Element element, ModelFormField modelFormField) {
@@ -3474,7 +3474,7 @@ public class ModelFormField {
if(element.hasAttribute("default-option")) {
this.defaultOption = element.getAttribute("default-option");
} else {
- this.defaultOption = UtilProperties.getPropertyValue("widget",
"widget.form.defaultTextFindOption", "like");
+ this.defaultOption = UtilProperties.getPropertyValue("widget",
"widget.form.defaultTextFindOption", "contains");
}
this.hideOptions =
"true".equals(element.getAttribute("hide-options")) ||
"options".equals(element.getAttribute("hide-options")) ? true
: false;