[Tree Extension] Improves criteria parsing in TreeDatasourceService
authorAugusto Mauch <augusto.mauch@openbravo.com>
Tue, 04 Mar 2014 19:15:14 +0100
changeset 22627 97f39970a49c
parent 22626 2ff2d436e084
child 22628 ae962c8ea2fe
[Tree Extension] Improves criteria parsing in TreeDatasourceService

If the criteria contains more than one subcriteria, it is neither a isDummyCriteria, a isSubtabCriteria or a isParentIdCriteria
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java	Tue Mar 04 18:59:04 2014 +0100
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java	Tue Mar 04 19:15:14 2014 +0100
@@ -303,7 +303,7 @@
     try {
       if (jsonCriteria.has("criteria")) {
         JSONArray criteriaArray = (JSONArray) jsonCriteria.get("criteria");
-        if (criteriaArray.length() > 0) {
+        if (criteriaArray.length() == 1) {
           return isSubtabCriteria(entity, criteriaArray.getJSONObject(0));
         } else {
           return false;
@@ -341,7 +341,7 @@
     try {
       if (jsonCriteria.has("criteria")) {
         JSONArray criteriaArray = (JSONArray) jsonCriteria.get("criteria");
-        if (criteriaArray.length() > 0) {
+        if (criteriaArray.length() == 1) {
           return isDummyCriteria(criteriaArray.getJSONObject(0));
         } else {
           return false;
@@ -368,7 +368,7 @@
     try {
       if (jsonCriteria.has("criteria")) {
         JSONArray criteriaArray = (JSONArray) jsonCriteria.get("criteria");
-        if (criteriaArray.length() > 0) {
+        if (criteriaArray.length() == 1) {
           return isParentIdCriteria(criteriaArray.getJSONObject(0));
         } else {
           return false;