details:   https://code.openbravo.com/erp/devel/pi/rev/0bdb0cb683ed
changeset: 25407:0bdb0cb683ed
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Wed Nov 26 13:38:02 2014 +0100
summary:   Related with bug 28246: Filter expression not reset after clearing 
the filters

The following problem has been detected while doing the QA for issue 28246: If 
a grid parameter has a display logic and a filter expression, then when the 
user clears the filter the filter expression will be momentarily removed, and 
then reset again.

This happened because there was some code that tried to guarantee that the grid 
was loaded the first time that is was made visible and that had the filter 
expression applied, but was not checking properly that the grid was not loaded 
yet. This resulted in reapplying the filter expression each time the grid is 
redrawn.

This has been fixed by checking properly if the grid has already loaded its 
data (in that case its data property will be an instance of ResultSet).

details:   https://code.openbravo.com/erp/devel/pi/rev/30e8d84ac147
changeset: 25408:30e8d84ac147
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Wed Nov 26 13:47:58 2014 +0100
summary:   Fixes issue 27829: Column order definition in HQL tables does not 
matter

There was already a mechanism in place to support that the order of the columns 
in the HQL query is different from the order of the columns in the application 
dictionary. The problem was that this mechanism was not working properly when 
the column aliases had uppercase characters, due to a missimg .toLowercase 
statement in the Entity.getPropertyByColumnName method. Due to this bug the 
HQLDataSourceService was not able to find the properties of the entity based on 
the column alias, and was instead using the index of the column to  pick the 
value from the result array, making the column order relevant.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
 |  19 +++++----
 src/org/openbravo/base/model/Entity.java                                       
                                      |   2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)

diffs (41 lines):

diff -r 3702a2c3cb7e -r 30e8d84ac147 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
      Mon Dec 08 10:38:25 2014 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
      Wed Nov 26 13:47:58 2014 +0100
@@ -190,14 +190,17 @@
       } catch (_exception) {
         isc.warn(_exception + ' ' + _exception.message + ' ' + 
_exception.stack);
       }
-      if (item.getType() === 'OBPickEditGridItem') {
-        if (originalShowIfValue && item.defaultFilter !== null && 
!isc.isA.emptyObject(item.defaultFilter)) {
-          item.canvas.viewGrid.setFilterEditorCriteria(item.defaultFilter);
-          item.canvas.viewGrid.filterByEditor();
-        } else if (originalShowIfValue && item.canvas && item.canvas.viewGrid 
&& !isc.isA.ResultSet(item.canvas.viewGrid.data)) {
-          // if the item is a grid that has display logic and is being 
displayed for the 
-          // first time (its data is not a ResultSet), load it 
-          item.canvas.viewGrid.refreshGrid();
+      if (originalShowIfValue && item.getType() === 'OBPickEditGridItem') {
+        // load the grid if it is being shown for the first time
+        if (item.canvas && item.canvas.viewGrid && 
!isc.isA.ResultSet(item.canvas.viewGrid.data)) {
+          if (item.defaultFilter !== null && 
!isc.isA.emptyObject(item.defaultFilter)) {
+            // if it has a default filter, apply it and use it when filtering
+            item.canvas.viewGrid.setFilterEditorCriteria(item.defaultFilter);
+            item.canvas.viewGrid.filterByEditor();
+          } else {
+            // if it does not have a default filter, just refresh the grid
+            item.canvas.viewGrid.refreshGrid();
+          }
         }
       }
       if (this.view && this.view.theForm) {
diff -r 3702a2c3cb7e -r 30e8d84ac147 src/org/openbravo/base/model/Entity.java
--- a/src/org/openbravo/base/model/Entity.java  Mon Dec 08 10:38:25 2014 +0100
+++ b/src/org/openbravo/base/model/Entity.java  Wed Nov 26 13:47:58 2014 +0100
@@ -586,7 +586,7 @@
    * @throws CheckException
    */
   public Property getPropertyByColumnName(String columnName, boolean 
checkIsNotNull) {
-    final Property prop = propertiesByColumnName.get(columnName);
+    final Property prop = propertiesByColumnName.get(columnName.toLowerCase());
     if (checkIsNotNull) {
       Check.isNotNull(prop, "Property " + columnName + " does not exist for 
entity " + this);
     }

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to