details: https://code.openbravo.com/erp/devel/pi/rev/b6be50096d40
changeset: 13281:b6be50096d40
user: Martin Taal <martin.taal <at> openbravo.com>
date: Tue Jul 26 17:20:04 2011 +0200
summary: Related to issue 18072 Focus handling in form and grid editing needs
to be cleaned up, results in unpredictable behavior
For a list item having select on focus resulted in only one character
displaying, solved this by explicitly selecting the value
The focus in next item was incorrectly setting the focus to the first error
field
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
| 6 +++++-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
| 10 ++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diffs (47 lines):
diff -r 064818230f9a -r b6be50096d40
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
Tue Jul 26 17:31:20 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
Tue Jul 26 17:20:04 2011 +0200
@@ -38,8 +38,12 @@
// https://issues.openbravo.com/view.php?id=18075
// addUnknownValues: true,
changeOnKeyPress: false,
+
+ // if select on focus is true then only one character is selected all the
time
+ selectOnFocus: false,
+ // let it be selected explicitly when needed
+ doExplicitSelectOnFocus: true,
- selectOnFocus: true,
moveFocusOnPickValue: true,
// is overridden to keep track that a value has been explicitly picked
diff -r 064818230f9a -r b6be50096d40
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
Tue Jul 26 17:31:20 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
Tue Jul 26 17:20:04 2011 +0200
@@ -336,7 +336,7 @@
var items = this.getItems(), nextItem, itemsLength = items.length, item, i;
var errorFld = this.getFirstErrorItem();
- if (errorFld && errorFld.isFocusable(true)) {
+ if (!startItem && errorFld && errorFld.isFocusable(true)) {
// get rid of this one, to not set the focus back to this field
delete this.forceFocusedField;
@@ -1252,10 +1252,16 @@
// called when someone picks something from a picklist, the focus should go
to the next
// item
- focusInNextItem: function(currentItemName) {
+ focusInNextItem: function(currentItemName, delayed) {
+ if (!delayed) {
+ this.delayCall('focusInNextItem', [currentItemName, true], 100);
+ }
this.computeFocusItem(this.getField(currentItemName));
if (this.getFocusItem()) {
this.getFocusItem().focusInItem();
+ if (this.getFocusItem().doExplicitSelectOnFocus) {
+ this.getFocusItem().selectValue();
+ }
}
},
------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits