details:   https://code.openbravo.com/erp/devel/pi/rev/5492d5749d01
changeset: 17853:5492d5749d01
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Tue Sep 04 13:09:31 2012 +0200
summary:   Related to issue 21420: 'saveRow' focus logic is now more solid

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
 |  13 ++++++---
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 028586d56e8d -r 5492d5749d01 
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 Sep 03 16:28:10 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Tue Sep 04 13:09:31 2012 +0200
@@ -1387,10 +1387,13 @@
   // function
   saveRow: function () {
     var savingNewRecord = this.isNew,
-        storedFocusItem = this.getFocusItem(),
-        i, length, flds, form = this,
+        storedFocusItem, i, length, flds, form = this,
         ficCallDone, record, recordIndex, callback, viewsNotToRefresh;
 
+    if (this.getFocusItem()) {
+      storedFocusItem = this.getFocusItem();
+    }
+
     // store the value of the current focus item
     if (this.getFocusItem() && this.saveFocusItemChanged !== 
this.getFocusItem()) {
       this.getFocusItem().blur(this, this.getFocusItem());
@@ -1543,8 +1546,10 @@
 
       form.isSaving = false;
       view.toolBar.updateButtonState(true);
-      this.setFocusItem(storedFocusItem);
-      this.setFocusInForm();
+      if (form.isVisible() && storedFocusItem && 
storedFocusItem.isFocusable(true)) {
+        form.setFocusItem(storedFocusItem);
+        form.setFocusInForm();
+      }
 
       return false;
     };

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to