Fixes issue 20482: Tab does not move focus in grid editing if a field has a FIC call
authorMartin Taal <martin.taal@openbravo.com>
Sun, 13 May 2012 22:53:02 +0200
changeset 16502 8f6f2842e1f0
parent 16501 3e863f6c3a41
child 16505 fae3a9d99ec8
Fixes issue 20482: Tab does not move focus in grid editing if a field has a FIC call
The cell edit call to the smartclient code should be done before the blur, because the
cell edit end call programmatically moves the focus to the next field in case of a tab.
The blur will do a FIC call which forces the focus back into the original field, if it
is not reset by the superclass.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Sun May 13 22:46:18 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Sun May 13 22:53:02 2012 +0200
@@ -2054,33 +2054,17 @@
       this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
       return;
     }
-    if (ficCallDone) {
-      // get new value as the row can have changed
-      this.Super('cellEditEnd', [editCompletionEvent, this.getEditValue(rowNum, colNum)]);
-      return;
-    } else {
-      // only needed for non picklist fields
-      // as picklist fields will always have picked a value
-      // note that focusItem updatevalue for picklist can result in extra datasource requests
-      if (focusItem && !focusItem.hasPickList) {
-        focusItem.blur(focusItem.form, focusItem);
-        if (editForm.inFicCall) {
-          // use editValues object as the edit form will be re-used for a next row
-          var editValues = this.getEditValues(rowNum);
-          editValues.actionAfterFicReturn = {
-            target: this,
-            method: this.cellEditEnd,
-            parameters: [editCompletionEvent, newValue, true, autoSaveDone]
-          };
-          return;
-        }
-      }
-    }
     if (newValue) {
       this.Super('cellEditEnd', [editCompletionEvent, newValue]);
     } else {
       this.Super('cellEditEnd', [editCompletionEvent]);
     }
+    // only needed for non picklist fields
+    // as picklist fields will always have picked a value
+    // note that focusItem updatevalue for picklist can result in extra datasource requests
+    if (focusItem && !focusItem.hasPickList) {
+      focusItem.blur(focusItem.form, focusItem);
+    }
   },
 
   // overridden to set the enterkeyaction to nextrowstart in cases the current row