fixes issue 32940: allow iEquals operator in Custom Query Selectors
authorCarlos Aristu <carlos.aristu@openbravo.com>
Thu, 12 May 2016 13:59:40 +0200
changeset 29500 4631e87e35e7
parent 29499 20100cb9945a
child 29501 eea6dae45251
fixes issue 32940: allow iEquals operator in Custom Query Selectors
The criteria is being sent properly by the client side, but the iEquals operator was not being considered by the CustomQuerySelectorDatasource. It was filtering using a contains criteria instead.
modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java
--- a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java	Wed May 11 12:36:52 2016 +0200
+++ b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java	Thu May 12 13:59:40 2016 +0200
@@ -382,6 +382,9 @@
       if ("iStartsWith".equals(operator)) {
         whereClause = "upper(" + field.getClauseLeftPart() + ") LIKE upper("
             + getTypedParameterAlias(typedParameters, value.replaceAll(" ", "%") + "%") + ")";
+      } else if ("iEquals".equals(operator)) {
+        whereClause = "upper(" + field.getClauseLeftPart() + ") = upper("
+            + getTypedParameterAlias(typedParameters, value) + ")";
       } else {
         whereClause = "upper(" + field.getClauseLeftPart() + ") LIKE upper("
             + getTypedParameterAlias(typedParameters, "%" + value.replaceAll(" ", "%") + "%") + ")";