details:   https://code.openbravo.com/erp/devel/pi/rev/decd52611c97
changeset: 21377:decd52611c97
user:      Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date:      Thu Oct 24 13:40:04 2013 +0530
summary:   Fixes Issue 0024960: Field groups are not displayed under some 
circumstances.

The focus item value is lost during form reflow in some particular scenarios.
Do overcome this, retrieved the lost focus item value and set it again after 
form redraw if they are not the same.

diffstat:

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

diffs (20 lines):

diff -r fff6d1f95d3c -r decd52611c97 
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
     Thu Oct 24 13:09:55 2013 +0530
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Thu Oct 24 13:40:04 2013 +0530
@@ -1941,9 +1941,16 @@
   },
 
   redraw: function () {
+    var focusItemValue;
     this._isRedrawing = true;
+    //fetch the focus item value as it is lost sometimes during reflow. Refer 
issue https://issues.openbravo.com/view.php?id=24960
+    focusItemValue = this.getFocusItem() !== null ? 
this.getFocusItem().getValue() : null;
     this.Super('redraw', arguments);
     delete this._isRedrawing;
+    //reset focus item value if lost
+    if (focusItemValue !== null && this.getFocusItem() !== null && 
this.getFocusItem().getValue() !== focusItemValue) {
+      this.getFocusItem().setValue(focusItemValue);
+    }
     if (this.selectOnFocusStored) {
       this.selectOnFocus = this.previousSelectOnFocus;
       delete this.previousSelectOnFocus;

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to