Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029896Openbravo ERPA. Platformpublic2015-05-15 09:032015-05-26 09:48
alostale 
AugustoMauch 
urgentminorhave not tried
closedfixed 
5
 
3.0PR15Q3 
alostale
Core
No
0029896: double grid request when filtering grid after scrolling to 2nd page
If the user scrolls down a grid till reaching the second page, and then performs a filter that returns less than a page, the filtered records will be shown but a second grid requests will be done.
- Open the Country and Region window
- Scroll down until you see Iraq
- Open the browser developer tools and select the Network tab
- Enter Q in the name filter editor
   -> 2 identical requests are performed to the grid datasource, 2nd one is not necessary
Performance
related to defect 0029835 closed AugustoMauch Unlimited grid datasource request under certain circumstances 
related to defect 0031434 closed caristu Error thrown when refreshing the grid after canceling the creation of a record in a child tab 
causes defect 0031187 closed alostale [PR15Q4] Lazy filtering does not work when filtering the first time 
causes defect 00323963.0PR16Q2 closed inigosanchez cannot filter grid when it is grouped by a column 
Issue History
2015-05-15 09:03alostaleNew Issue
2015-05-15 09:03alostaleAssigned To => platform
2015-05-15 09:03alostaleModules => Core
2015-05-15 09:03alostaleTriggers an Emergency Pack => No
2015-05-15 09:04alostaleTag Attached: Performance
2015-05-15 09:04alostaleRelationship addedrelated to 0029835
2015-05-15 09:05alostaleStatusnew => scheduled
2015-05-15 09:05alostaleAssigned Toplatform => AugustoMauch
2015-05-15 10:03hgbotCheckin
2015-05-15 10:03hgbotNote Added: 0077482
2015-05-15 10:03hgbotStatusscheduled => resolved
2015-05-15 10:03hgbotResolutionopen => fixed
2015-05-15 10:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e5e79f23f31356be0a5acb7a9f0b182a5d60fc3d [^]
2015-05-15 11:02AugustoMauchIssue Monitored: alostale
2015-05-15 11:02AugustoMauchReview Assigned To => alostale
2015-05-15 11:27alostaleNote Added: 0077486
2015-05-15 11:27alostaleStatusresolved => closed
2015-05-15 11:27alostaleFixed in Version => 3.0PR15Q3
2015-05-15 18:29hgbotCheckin
2015-05-15 18:29hgbotNote Added: 0077505
2015-05-16 05:21hudsonbotCheckin
2015-05-16 05:21hudsonbotNote Added: 0077510
2015-05-16 05:21hudsonbotCheckin
2015-05-16 05:21hudsonbotNote Added: 0077513
2015-05-18 09:00alostaleStatusclosed => new
2015-05-18 09:00alostaleResolutionfixed => open
2015-05-18 09:00alostaleFixed in Version3.0PR15Q3 =>
2015-05-18 18:22hgbotCheckin
2015-05-18 18:22hgbotNote Added: 0077544
2015-05-18 18:22hgbotStatusnew => resolved
2015-05-18 18:22hgbotResolutionopen => fixed
2015-05-18 18:22hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/e5e79f23f31356be0a5acb7a9f0b182a5d60fc3d [^] => http://code.openbravo.com/erp/devel/pi/rev/2d6b8e5005b29bbca7ae4fd977ba6e18d8ac5201 [^]
2015-05-19 18:39hudsonbotCheckin
2015-05-19 18:39hudsonbotNote Added: 0077589
2015-05-26 09:48alostaleNote Added: 0077735
2015-05-26 09:48alostaleStatusresolved => closed
2015-05-26 09:48alostaleFixed in Version => 3.0PR15Q3
2015-10-27 08:21alostaleRelationship addedcauses 0031187
2015-11-11 18:31caristuRelationship addedrelated to 0031434
2016-03-04 10:52alostaleRelationship addedcauses 0032396

Notes
(0077482)
hgbot   
2015-05-15 10:03   
Repository: erp/devel/pi
Changeset: e5e79f23f31356be0a5acb7a9f0b182a5d60fc3d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri May 15 09:58:34 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e5e79f23f31356be0a5acb7a9f0b182a5d60fc3d [^]

Fixes issue 29896: Prevents unneded datasource request when filtering

When the grid was filtered in a scrolled down grid, two datasource requests to load the grid were bein
g done instead of one. This happened due to two reasons:
- The function scrollTo of the grid's body was being invoked while the grid was being filtered. This f
unction can be skipped in this case because when a datasource request is triggered due to a filter eve
nt, the grid is always automatically scrolled up to the top
- If the OBViewGrid.getRecord function was invoked in the middle of a datasource request, an additiona
l request was done. To prevent this, in this case the function returns Array.LOADING

To detect if the grid is in the process of doing a datasource request, the isFilteringExternally flag
is used. This flag is set in the handleFilterEditorSubmit function, and only if the change in the filt
er editor is going to trigger a datasource request. The flag is reset in the callback of that function
.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0077486)
alostale   
2015-05-15 11:27   
code reviewed

Tested by combining scroll, filter and refresh both in grid and form views. In all the cases no extra requests were observed.
(0077505)
hgbot   
2015-05-15 18:29   
Repository: erp/devel/pi
Changeset: ef5d66aa84cc8ece0e810d69cc5d80c2741e652c
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri May 15 18:27:18 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ef5d66aa84cc8ece0e810d69cc5d80c2741e652c [^]

Related with issue 29896: Fix backed out because it is breaks int-initial tests

A side effect of the changeset is making Selenium unable to know when a grid has been loaded under certain circumstances.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0077510)
hudsonbot   
2015-05-16 05:21   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/33b0ebaa36ae [^]
Maturity status: Test
(0077513)
hudsonbot   
2015-05-16 05:21   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/33b0ebaa36ae [^]
Maturity status: Test
(0077544)
hgbot   
2015-05-18 18:22   
Repository: erp/devel/pi
Changeset: 2d6b8e5005b29bbca7ae4fd977ba6e18d8ac5201
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon May 18 18:20:40 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2d6b8e5005b29bbca7ae4fd977ba6e18d8ac5201 [^]

Fixes issue 29896: Prevents unneded datasource request when filtering

When the grid was filtered in a scrolled down grid, two datasource requests to load the grid were being done instead of one. This happened due to two reasons:
- The function scrollTo of the grid's body was being invoked while the grid was being filtered. This function can be skipped in this case because when a datasource request is triggered due to a filter event, the grid is always automatically scrolled up to the top
- If the OBViewGrid.getRecord function was invoked in the middle of a datasource request, an additional request was done. To prevent this, in this case the function returns Array.LOADING

To detect if the grid is in the process of doing a datasource request, the isFilteringExternally flag is used. This flag is set in the handleFilterEditorSubmit function, and only if the change in the filter editor is going to trigger a datasource request. The flag is reset in the callback of that function.

This previous fix did not work properly, as the criteria passed to the willFetchData function was not proper, it needed to the processed in the convertCriteria function.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0077589)
hudsonbot   
2015-05-19 18:39   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/877209d1525b [^]
Maturity status: Test
(0077735)
alostale   
2015-05-26 09:48   
code reviewed

tested with different combinations of scrolling, filtering and refreshing