Fixes issue 23889: Multiple requests to selector datasource in manual popups
authorAugusto Mauch <augusto.mauch@openbravo.com>
Fri, 20 Jun 2014 11:42:57 +0200
changeset 23852 032fb3d55363
parent 23851 ccf086dfbe29
child 23853 d615b5db09cd
Fixes issue 23889: Multiple requests to selector datasource in manual popups

Pick lists and grids use a property called drawAllMaxCells, that is used to determine how many cells should be fetched from the datasource, its default value is 250. If after making a datasource call smartclient finds out that the number of retrieved cells is lower than drawAllMaxCells, it will do another datasource call, and repeat this process until the number of cells fetched are higher than drawAllMaxCells or until all cells have been fetched.

This is not the intented behaviour, we want the rows to be fetched when the user scrolls down and is out of cached rows. This is achieved by setting drawAllMaxCells to 0.
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js
--- a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js	Fri Jun 20 00:46:38 2014 +0200
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js	Fri Jun 20 11:42:57 2014 +0200
@@ -701,6 +701,8 @@
       pickListWidth: this.width,
       pickListProperties: {
         fetchDelay: 400,
+        // prevents additional requests when loading data
+        drawAllMaxCells: 0,
         showHeaderContextMenu: false,
         hide: function () {
           this.Super('hide', arguments);