Fixes issue 18149: Field shows error when form is shown
authorMartin Taal <martin.taal@openbravo.com>
Mon, 01 Aug 2011 15:51:20 +0200
changeset 13362 c087bb4d81c2
parent 13361 2430d7a85bb1
child 13363 b6c381dc939e
child 13373 9a1b39822915
Fixes issue 18149: Field shows error when form is shown
This was caused by a blur done when initializing the form, prevented the blur when initializing
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	Mon Aug 01 15:33:44 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Aug 01 15:51:20 2011 +0200
@@ -176,6 +176,8 @@
   },
   
   doEditRecordActions: function(preventFocus, isNew){
+    this.initializing = true;
+    
     delete this.validateAfterFicReturn;
     
     // only compute a new focus item if the form is active
@@ -534,6 +536,7 @@
         // remember the initial values, if we are still editing the same row
         me.rememberValues();
       }
+      me.initializing = false;
     });
   },
   
@@ -715,7 +718,7 @@
       if (this.getFocusItem()) {
         if (this.allItemsDisabled) {
           this.storeFocusItem();
-          if (this.getFocusItem()) {
+          if (this.getFocusItem() && !this.initializing) {
             this.getFocusItem().blurItem();
           }
           this.setHandleDisabled(state);