fixed bug 26817: incorrect handling of enter event
authorAsier Lostalé <asier.lostale@openbravo.com>
Tue, 17 Jun 2014 08:26:14 +0200
changeset 23495 738d333f9c80
parent 23494 f7f0ca2438da
child 23496 bcb2db0f0a22
child 26578 c84b7a8c86d1
fixed bug 26817: incorrect handling of enter event

moved code to generic FormItem to handle this case in all scenarios
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-formitem-fk-combo.js
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk.js	Tue Jun 17 01:53:20 2014 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk.js	Tue Jun 17 08:26:14 2014 +0200
@@ -47,18 +47,5 @@
       this._editorEnterValue = null;
     }
     this.Super('setValue', arguments);
-  },
-  
-  /**
-   * handles a corner case where the event of the previous field is called for the current field,
-   * refer issue https://issues.openbravo.com/view.php?id=26817. In this case, the event is not triggered.
-   */
-  handleKeyPress: function (event, eventInfo) {
-    var key = isc.EH.lastEvent.keyName;
-    if (key === 'Enter' && event.itemInfo && event.itemInfo.item && event.itemInfo.item.name && event.itemInfo.item.name !== this.name) {
-      return true;
-    } else {
-      return this.Super('handleKeyPress', arguments);
-    }
   }
 });
\ No newline at end of file
--- a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-formitem-fk-combo.js	Tue Jun 17 01:53:20 2014 +0000
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-formitem-fk-combo.js	Tue Jun 17 08:26:14 2014 +0200
@@ -183,18 +183,5 @@
       }
     }
     this.Super('destroy', arguments);
-  },
-
-  /**
-   * handles a corner case where the event of the previous field is called for the current field,
-   * refer issue https://issues.openbravo.com/view.php?id=26817. In this case, the event is not triggered.
-   */
-  handleKeyPress: function (event, eventInfo) {
-    var key = isc.EH.lastEvent.keyName;
-    if (key === 'Enter' && event.itemInfo && event.itemInfo.item && event.itemInfo.item.name && event.itemInfo.item.name !== this.name) {
-      return true;
-    } else {
-      return this.Super('handleKeyPress', arguments);
-    }
   }
 });
\ No newline at end of file
--- a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Tue Jun 17 01:53:20 2014 +0000
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js	Tue Jun 17 08:26:14 2014 +0200
@@ -518,8 +518,18 @@
       return false;
     }
     return this.Super('useDisabledEventMask', arguments);
+  },
+
+  // handles a corner case where the event of the previous field is called for the current field,
+  // refer issue https://issues.openbravo.com/view.php?id=26817. In this case, the event is not triggered.
+  handleKeyPress: function (event, eventInfo) {
+    var key = isc.EH.lastEvent.keyName;
+    if (key === 'Enter' && event.itemInfo && event.itemInfo.item && event.itemInfo.item.name && event.itemInfo.item.name !== this.name) {
+      return true;
+    } else {
+      return this.Super('handleKeyPress', arguments);
+    }
   }
-
 });
 
 // NOTE BEWARE: methods/props added here will overwrite and NOT extend FormItem