details:   https://code.openbravo.com/erp/devel/pi/rev/6b3bd537dc33
changeset: 14791:6b3bd537dc33
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Fri Dec 02 02:36:36 2011 +0100
summary:   Related to issue 19211: Tab level does not change until third try
If the tab level is first cleared and then is set to 0 the 0 value is not saved 
because SC does not
see a difference between 0 and ""

details:   https://code.openbravo.com/erp/devel/pi/rev/c71badabc918
changeset: 14792:c71badabc918
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Fri Dec 02 02:37:47 2011 +0100
summary:   Fixes issue 19212: The suggestion feature in the dropdowns is broken
The picklist is shown but hidden directly because the field looses focus 
through a redraw, prevent
hiding of the picklist for a focused field when a form gets redrawn

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
 |  12 ++++++++++
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
              |   2 +
 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
   |   8 ++++++
 3 files changed, 22 insertions(+), 0 deletions(-)

diffs (53 lines):

diff -r fb4d253fd479 -r c71badabc918 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
        Fri Dec 02 01:06:17 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
        Fri Dec 02 02:37:47 2011 +0100
@@ -45,6 +45,18 @@
 
   moveFocusOnPickValue: true,
 
+  hidePickListOnBlur: function() {
+    
+    // when the form gets redrawn the the focus may not be in
+    // the item but it is still the item which gets the focus
+    // after redrawing
+    if (this.form && this.form.redrawing && this.form.getFocusItem() === this) 
{
+      return true;
+    }
+    
+    this.Super('hidePickListOnBlur', arguments);
+  },
+  
   // is overridden to keep track that a value has been explicitly picked
   pickValue: function(value) {
     this._pickedValue = true;
diff -r fb4d253fd479 -r c71badabc918 
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
     Fri Dec 02 01:06:17 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Fri Dec 02 02:37:47 2011 +0100
@@ -1647,7 +1647,9 @@
   },
   
   redraw: function() {
+    this.redrawing = true;
     this.Super('redraw', arguments);
+    delete this.redrawing;
     this.selectOnFocus = this.previousSelectOnFocus;
     delete this.previousSelectOnFocus;
   },
diff -r fb4d253fd479 -r c71badabc918 
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
--- 
a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
  Fri Dec 02 01:06:17 2011 +0100
+++ 
b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
  Fri Dec 02 02:37:47 2011 +0100
@@ -427,6 +427,14 @@
     if (val1NullOrUndefined && val2NullOrUndefined) {
       return true;
     }
+    // a special case, smartclient makes a mistake when comparing
+    // zero against an empty string
+    if (value1 === 0 && value2 !== 0) {
+      return false;
+    }
+    if (value2 !== 0 && value2 === 0) {
+      return false;
+    }
     return this._original_compareValues(value1, value2);
   },
   

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to