Related to issue 18072 Focus handling in form and grid editing needs to be cleaned up, results in unpredictable behavior
authorMartin Taal <martin.taal@openbravo.com>
Sun, 24 Jul 2011 05:55:51 +0200
changeset 13257 df0fc02d0865
parent 13256 de806a497fba
child 13258 da2bcbd5acc9
Related to issue 18072 Focus handling in form and grid editing needs to be cleaned up, results in unpredictable behavior
Solve this: open a form, click on a combo (not the first one), select something from the combo, the focus is moved to the first field instead of the field after the combo
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	Sat Jul 23 16:34:13 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Sun Jul 24 05:55:51 2011 +0200
@@ -344,13 +344,15 @@
       return;
     }
     
-    if (this.forceFocusedField) {
+    if (!startItem && this.forceFocusedField) {
       item = this.getItem(this.forceFocusedField);
       delete this.forceFocusedField;
       if(item && item.isFocusable(true)) {
         this.setFocusItem(item);
         return;
       }
+    } else {
+      delete this.forceFocusedField;
     }
 
     if (!startItem && this.firstFocusedField) {
@@ -1442,7 +1444,6 @@
     delete this.storedFocusItem;
     delete this.storedSelectionRange;    
   }
-  
 };
 
 isc.OBViewForm.addProperties(OB.ViewFormProperties);