details:   /erp/devel/pi/rev/bb06abdd13c1
changeset: 12208:bb06abdd13c1
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Tue May 17 21:08:54 2011 +0200
summary:   Prevent caching in the selector item in the standard way

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
             |  16 +------
 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
 |  21 +--------
 2 files changed, 5 insertions(+), 32 deletions(-)

diffs (72 lines):

diff -r 9c8382863b3b -r bb06abdd13c1 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Tue May 17 21:05:00 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Tue May 17 21:08:54 2011 +0200
@@ -706,11 +706,7 @@
     if (prop === OB.Constants.ID) {
       return;
     }
-    
-    if (field && field.resetCache) {
-      field.resetCache();
-    }
-    
+     
     // note field can be a datasource field, see above, in that case
     // don't set the entries    
     if (field.form && entries) {
@@ -944,15 +940,7 @@
     // remove the message
     this.setHasChanged(true);
     this.view.messageBar.hide();
-    this.view.toolBar.updateButtonState(true);
-    
-    // invalidate the cache of picklists on a change
-    for (i = 0; i < this.getFields().length; i++) {
-      if (this.getFields()[i].resetCache) {
-        this.getFields()[i].resetCache();
-      }
-   }
- 
+    this.view.toolBar.updateButtonState(true); 
   },
   
   // make sure that any field errors also appear in the grid
diff -r 9c8382863b3b -r bb06abdd13c1 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
--- 
a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Tue May 17 21:05:00 2011 +0200
+++ 
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Tue May 17 21:08:54 2011 +0200
@@ -404,16 +404,6 @@
     return this.Super('init', arguments);
   },
   
-  // reset the cache without reloading directly
-  resetCache: function() {
-    if (this.pickList && this.pickList.data) {
-      // don't use field.pickList.invalidateCache as it will force a fetch
-      // the fetch is only needed later when someone really changes the value
-      this.pickList.data.invalidateRows();
-      this.pickList.data.totalRows = 0;
-    }
-  },
-  
   setValueFromRecord: function(record, fromPopup){
     var currentValue = this.getValue();
     if (!record) {
@@ -535,15 +525,10 @@
                      _constructor: 'AdvancedCriteria',
                      criteria:[]};
 
-    // add organization to the criteria as a dummy
     var contextInfo = this.form.view.getContextInfo(false, true);
-    if (contextInfo.inpadOrgId) {
-        criteria.criteria.push({
-          fieldName: '_dummy',
-          operator: 'equals',
-          value: contextInfo.inpadOrgId
-        });
-    }
+
+    // add a dummy criteria to force a fetch
+    criteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
 
     // only filter if the display field is also passed
     // the displayField filter is not passed when the user clicks the 
drop-down button

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to