[calendar] Adapted OBTimeItem to be used out of a OBViewForm
authorDavid Baz Fayos <david.baz@openbravo.com>
Mon, 14 Jan 2013 17:16:46 +0100
changeset 19508 20a19da0ce17
parent 19507 6b36d3051829
child 19509 b7f8a63e877c
[calendar] Adapted OBTimeItem to be used out of a OBViewForm
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js	Mon Jan 14 17:14:16 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js	Mon Jan 14 17:16:46 2013 +0100
@@ -39,9 +39,10 @@
   // from this method form.itemChangeActions
   keyPress: function (item, form, keyName, characterValue) {
     var i, f = this.form,
-        toolBarButtons = f.view.toolBar.leftMembers;
+        toolBarButtons;
 
-    if (characterValue || keyName === 'Backspace' || keyName === 'Delete') {
+    if ((f && f.view && f.view.toolBar && f.view.messageBar && f.setHasChanged) && (characterValue || keyName === 'Backspace' || keyName === 'Delete')) {
+      toolBarButtons = f.view.toolBar.leftMembers;
       f.setHasChanged(true);
       f.view.messageBar.hide();
       for (i = 0; i < toolBarButtons.length; i++) {