Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021699Openbravo ERPB. User interfacepublic2012-09-20 15:362012-09-28 14:39
plujan 
dbaz 
normalminorhave not tried
closedfixed 
5
main 
3.0MP16 
AugustoMauch
Mozilla Firefox
Core
No
0021699: Selecting the first record using keyboard does not update children tabs
When working using only keyboard, if the first record is selected the children's data is not refreshed. It only happens for the first record, and when the next record updates the children's data, the first record also starts working fine.
Note: the wrong behaviour is at step 7.

1. Login as Openbravo user
2. Go to Sales Invoice
3. Create two sales invoices. First one with a line and second one with no lines
4. Close the tab
5. Open the tab again. You will see both invoices. The focus is located in filtering section.
6. Hit Esc key to go to the records
7. Hit the Down Key to select first record. The record is selected but no update on children tabs (see screenshot)
8. Hit the Down Key to select second record. The record is selected and the data is updated in all the tabs.
9. Hit the Up Key to select first record again. The record is selected and the data is updated in all the tabs.
No tags attached.
png mp15_SelectingFirstRecord.png (55,323) 2012-09-20 15:36
https://issues.openbravo.com/file_download.php?file_id=5587&type=bug
png
Issue History
2012-09-20 15:36plujanNew Issue
2012-09-20 15:36plujanAssigned To => dbaz
2012-09-20 15:36plujanFile Added: mp15_SelectingFirstRecord.png
2012-09-20 15:36plujanWeb browser => Mozilla Firefox
2012-09-20 15:36plujanModules => Core
2012-09-21 10:35plujanWeb browserMozilla Firefox => Mozilla Firefox
2012-09-21 10:35plujanSummarySelecting the fist record using keyboard does not update children tabs => Selecting the first record using keyboard does not update children tabs
2012-09-26 11:49AugustoMauchNote Added: 0052615
2012-09-26 11:49AugustoMauchNote Edited: 0052615bug_revision_view_page.php?bugnote_id=0052615#r3906
2012-09-26 11:49AugustoMauchNote Edited: 0052615bug_revision_view_page.php?bugnote_id=0052615#r3907
2012-09-26 20:59dbazNote Added: 0052815
2012-09-26 20:59dbazWeb browserMozilla Firefox => Mozilla Firefox
2012-09-26 20:59dbazAssigned Todbaz => AugustoMauch
2012-09-26 20:59dbazAssigned ToAugustoMauch => dbaz
2012-09-26 21:00dbazClosed by => AugustoMauch
2012-09-26 21:00dbazWeb browserMozilla Firefox => Mozilla Firefox
2012-09-26 21:00dbazIssue Monitored: AugustoMauch
2012-09-26 21:10hgbotCheckin
2012-09-26 21:10hgbotNote Added: 0052816
2012-09-26 21:10hgbotStatusnew => resolved
2012-09-26 21:10hgbotResolutionopen => fixed
2012-09-26 21:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8400af3c6115d00acc89a475f854b329dc3516be [^]
2012-09-27 13:59AugustoMauchNote Added: 0052836
2012-09-27 13:59AugustoMauchStatusresolved => closed
2012-09-27 13:59AugustoMauchFixed in Version => 3.0MP16
2012-09-28 14:39hudsonbotCheckin
2012-09-28 14:39hudsonbotNote Added: 0052917

Notes
(0052615)
AugustoMauch   
2012-09-26 11:49   
I think the problem is caused by smartclient's _navigateToNextRecord function implementation. In openbravo, if the user selects a row different to the currently selected one, its child tabs are refreshed. If it clicks repeatedly on an already selected row, the child tabs are not refreshed.

This is expected, and is implemented this way in smartclient's ListGrid [1]. The problem of the current issue is the initalization of the originalSelection variable [2]. It will be initialized to 0 when the previously selected row was the first one (as expected), but also when no row was selected. In this case, which is the one reproduced in this issue, originalSelection will be initialized to 0, and provided that the newSelectionIndex is also 0, it will not trigger a row change.


[1] https://code.openbravo.com/erp/mods/org.openbravo.userinterface.smartclient.dev/file/c527354e4088/web/org.openbravo.userinterface.smartclient/isomorphic/client/widgets/ListGrid.js#l20009 [^]

[2]https://code.openbravo.com/erp/mods/org.openbravo.userinterface.smartclient.dev/file/c527354e4088/web/org.openbravo.userinterface.smartclient/isomorphic/client/widgets/ListGrid.js#l19959 [^]

(0052815)
dbaz   
2012-09-26 20:59   
The new behavior after this fix is:
If ESC key is presed while the focus is in the filter, focus in grid but:
* If there is no record selected in the grid, automatically select the first one
* If there is already a record (or several records) selected in the grid, the focus goes to that one (this behavior was present too before this fix)
* If we are in a OBGridView (and just in a OBGridView) and the grid doesn't have any row to show (empty grid), ESC key won't perform any action, so the focus will remain in the filter.

Related to the last point: this behavior is desired only in OBGridView because there are not other place (besides of switching the tab) where the user could move (if the grid doesn't have rows), but if the grid is in the middle of something (linked items, selector, alerts, ...), maybe the user just want to press ESC (so the focus will move to an empty grid), and then continue pressing tab or do whatever to move away the grid, without the need of tabbing through all filter fields to exit the grid.
(0052816)
hgbot   
2012-09-26 21:10   
Repository: erp/devel/pi
Changeset: 8400af3c6115d00acc89a475f854b329dc3516be
Author: David Baz Fayos <david.baz <at> openbravo.com>
Date: Wed Sep 26 21:04:54 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/8400af3c6115d00acc89a475f854b329dc3516be [^]

Fixed issue 21699: Now 'ESC' while in grid filters moves the focus
to the first grid row (if there is no anyone already selected)

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
---
(0052836)
AugustoMauch   
2012-09-27 13:59   
Code reviewed and verified in pi@cc9c7512f7e1
(0052917)
hudsonbot   
2012-09-28 14: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/6d2f8cffd4b1 [^]

Maturity status: Test