details:   https://code.openbravo.com/erp/devel/main/rev/1b6f10404788
changeset: 19225:1b6f10404788
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Tue Jan 15 16:39:56 2013 +0100
summary:   Fixes issue 22801: ID of product not shown if the full product name 
is entered

The problem was that in the changed function the setElementValue was being 
called passing newValue as an argument. If the product name is not entered 
completely, then newValue will be the incomplete name and nothing wrong will 
happen. The problem is that if the full name is entered, newValue is the 
product ID, and when it is passed as an argument to setElementValue it is shown 
as is.

This has been fixed by passing the newValue to the mapValueToDisplay function. 
If newValue is a partial name the function will return the partial name, and if 
newValue is the product ID, it will return the product full name.

details:   https://code.openbravo.com/erp/devel/main/rev/fd1963891b04
changeset: 19226:fd1963891b04
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Tue Jan 15 18:29:01 2013 +0100
summary:   Related to issue 22801: Refactors fix to prevent regression

The fix has been refactored, because the previous approach was causing a 
regression. Now, the mapValueToDisplay will only be used if the newValue is an 
UUID, and that function will not be used in the filterDataBoundPickList 
function (it was not needed).

diffstat:

 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
 |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 7f11e5f3dcfc -r fd1963891b04 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
--- 
a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Wed Jan 16 01:45:59 2013 +0000
+++ 
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Tue Jan 15 18:29:01 2013 +0100
@@ -402,13 +402,19 @@
   // changed handles the case that the user removes the value using the 
keyboard
   // this should do the same things as setting the value through the pickvalue
   changed: function (form, item, newValue) {
+    var identifier;
     // only do the identifier actions when clearing
     // in all other cases pickValue is called
     if (!newValue) {
       this.setValueFromRecord(null);
     }
+    if (OB.Utilities.isUUID(newValue)) {
+      identifier = this.mapValueToDisplay(newValue);
+    } else {
+      identifier = newValue;
+    }
     //Setting the element value again to align the cursor position correctly.
-    this.setElementValue(newValue);
+    this.setElementValue(identifier);
   },
 
   setPickListWidth: function () {

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to