Related with issue 29612: handle properly fk filter properties
authorAugusto Mauch <augusto.mauch@openbravo.com>
Mon, 18 May 2015 12:28:44 +0200
changeset 27076 c8311f845ea4
parent 27075 cf34375332d2
child 27077 a9a39c837d3b
Related with issue 29612: handle properly fk filter properties
>
> If the disableFkDropdown grid configuration is enabled, then the allowFkFilterByIdentifier and showFkDropdownUnfiltered should not be taken into account. Otherwise the user could configure the grid in a way that the fintering of a column is enabled, but non functional
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/ForeignKeyUIDefinition.java
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/ForeignKeyUIDefinition.java	Mon May 18 10:49:53 2015 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/ForeignKeyUIDefinition.java	Mon May 18 12:28:44 2015 +0200
@@ -63,19 +63,20 @@
       }
     }
 
-    Boolean allowFkFilterByIdentifier = (Boolean) readGridConfigurationSetting("allowFkFilterByIdentifier");
-    if (Boolean.FALSE.equals(allowFkFilterByIdentifier)) {
-      append = append + ", allowFkFilterByIdentifier: " + allowFkFilterByIdentifier.toString();
-    }
-
-    Boolean showFkDropdownUnfiltered = (Boolean) readGridConfigurationSetting("showFkDropdownUnfiltered");
-    if (Boolean.TRUE.equals(showFkDropdownUnfiltered)) {
-      append = append + ", showFkDropdownUnfiltered: " + showFkDropdownUnfiltered.toString();
-    }
-
     Boolean disableFkDropdown = (Boolean) readGridConfigurationSetting("disableFkDropdown");
     if (Boolean.TRUE.equals(disableFkDropdown)) {
       append = append + ", disableFkDropdown: " + disableFkDropdown.toString();
+    } else {
+      // these configurations only apply if the fk filter combo is enabled
+      Boolean allowFkFilterByIdentifier = (Boolean) readGridConfigurationSetting("allowFkFilterByIdentifier");
+      if (Boolean.FALSE.equals(allowFkFilterByIdentifier)) {
+        append = append + ", allowFkFilterByIdentifier: " + allowFkFilterByIdentifier.toString();
+      }
+
+      Boolean showFkDropdownUnfiltered = (Boolean) readGridConfigurationSetting("showFkDropdownUnfiltered");
+      if (Boolean.TRUE.equals(showFkDropdownUnfiltered)) {
+        append = append + ", showFkDropdownUnfiltered: " + showFkDropdownUnfiltered.toString();
+      }
     }
 
     return super.getFilterEditorPropertiesProperty(field) + append;