Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028178Openbravo ERPA. Platformpublic2014-11-14 14:412014-12-30 23:26
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
3.0PR15Q1 
alostale
Core
No
0028178: Disable the Refresh toolbar button while a refresh is ongoing
If the request done when refreshing takes some time, the user might have time to click the Refresh toolbar button several times. In that case, a request is done each time the button is clicked, even if the previous requests are ongoing.

It is better to prevent the user from clicking the button if the grid is currently being refreshed. This will prevent accidentally clicking the button several times, which would result in sending unneeded requests to the server.
-
No tags attached.
related to design defect 0025811 closed AugustoMauch unnecessary request on grid refresh 
related to feature request 0028179 new AugustoMauch Give some visual feedback in the Refesh toolbar button whhen the grid is being refreshed 
Issue History
2014-11-14 14:41AugustoMauchNew Issue
2014-11-14 14:41AugustoMauchAssigned To => AugustoMauch
2014-11-14 14:41AugustoMauchModules => Core
2014-11-14 14:41AugustoMauchTriggers an Emergency Pack => No
2014-11-14 14:45AugustoMauchRelationship addedrelated to 0025811
2014-11-14 14:51AugustoMauchRelationship addedrelated to 0028179
2014-11-21 12:14hgbotCheckin
2014-11-21 12:14hgbotNote Added: 0071880
2014-11-21 12:14hgbotStatusnew => resolved
2014-11-21 12:14hgbotResolutionopen => fixed
2014-11-21 12:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/02671874363fb612b2c45a85e8ddf63a32bf7f87 [^]
2014-11-21 12:16AugustoMauchNote Added: 0071882
2014-11-21 12:16AugustoMauchStatusresolved => new
2014-11-21 12:16AugustoMauchResolutionfixed => open
2014-11-24 11:07hgbotCheckin
2014-11-24 11:07hgbotNote Added: 0071927
2014-11-24 11:07hgbotStatusnew => resolved
2014-11-24 11:07hgbotResolutionopen => fixed
2014-11-24 11:07hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/02671874363fb612b2c45a85e8ddf63a32bf7f87 [^] => http://code.openbravo.com/erp/devel/pi/rev/ef0ca38cde5d086d7840404b1212c0535d727a21 [^]
2014-11-24 11:11hgbotCheckin
2014-11-24 11:11hgbotNote Added: 0071928
2014-11-24 11:21AugustoMauchNote Added: 0071929
2014-11-28 12:46alostaleReview Assigned To => alostale
2014-11-28 12:46alostaleNote Added: 0072124
2014-11-28 12:46alostaleStatusresolved => closed
2014-11-28 12:46alostaleFixed in Version => 3.0PR15Q1
2014-12-30 23:26hudsonbotCheckin
2014-12-30 23:26hudsonbotNote Added: 0073122
2014-12-30 23:26hudsonbotCheckin
2014-12-30 23:26hudsonbotNote Added: 0073128
2014-12-30 23:26hudsonbotCheckin
2014-12-30 23:26hudsonbotNote Added: 0073129

Notes
(0071880)
hgbot   
2014-11-21 12:14   
Repository: erp/devel/pi
Changeset: 02671874363fb612b2c45a85e8ddf63a32bf7f87
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Nov 21 12:07:15 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/02671874363fb612b2c45a85e8ddf63a32bf7f87 [^]

Fixes issue 28178: Local edits are discarded when the grid is refreshed

If there is a validation error when editing the row of a grid, that change is stored in the local edits of the grid, but not persisted in the database. The problem was that when the grid was refreshed the updated records returned by the datasource where being overwritten with the grid local changes.

This behaviour was wrong, when the grid is refreshed all changes should be discarded. To fix this, the local edits of the grid are discarded when the grid is refreshed, right after invalidating the cache.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0071882)
AugustoMauch   
2014-11-21 12:16   
Closed accidentally due to error in commit message
(0071927)
hgbot   
2014-11-24 11:07   
Repository: erp/devel/pi
Changeset: ef0ca38cde5d086d7840404b1212c0535d727a21
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Nov 24 10:59:39 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ef0ca38cde5d086d7840404b1212c0535d727a21 [^]

Fixes issue 28178: Disable refresh button while the view is being refreshed

Before the fix, the user could press the refresh toolbar button several times before the response of the first one was received. This could result in the server being overloaded. To prevent this, now when
then user clicks on the refresh toolbar button, the button is disabled until the response is received.

To ensure that the refresh button is always enabled even if an error happens, the button is being enabled in several places:
- If the refresh process is successful: In the callback of the refresh function.
- If there is an error between the refresh function is called and the request is actually sent: In a try/catch block
- If the server returns with an error code: In the RPCManager.handleError function

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
M modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
---
(0071928)
hgbot   
2014-11-24 11:11   
Repository: erp/devel/pi
Changeset: 31a1f49e05a85da4d852c678df1acf97ef5be301
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Nov 24 11:09:01 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/31a1f49e05a85da4d852c678df1acf97ef5be301 [^]

Related with issue 28178: Revert changes made for debugging purposes

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
---
(0071929)
AugustoMauch   
2014-11-24 11:21   
Tips for testing:
- Add a Thread.sleep statement to the DefaultJsonDataService.fetch method to slow down the refresh and see that the button is actually being disabled
- Force an error in the response of the datasource by throwing an AccessTableNoView exception (see how to do it in the changeset [1])

[1] https://code.openbravo.com/erp/devel/pi/rev/31a1f49e05a85da4d852c678df1acf97ef5be301 [^]
(0072124)
alostale   
2014-11-28 12:46   
code reviewed

Tested:
-While refreshing the UI changes
-During this time clicking on the refresh button does not generate extra request
-In case of failure in the request, it is properly handled and the refresh button is enabled again
(0073122)
hudsonbot   
2014-12-30 23:26   
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/6525fe229e06 [^]
Maturity status: Test
(0073128)
hudsonbot   
2014-12-30 23:26   
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/6525fe229e06 [^]
Maturity status: Test
(0073129)
hudsonbot   
2014-12-30 23:26   
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/6525fe229e06 [^]
Maturity status: Test