Fixes issue 16113: DB Id shows in Financial Transaction add payment
authorMartin Taal <martin.taal@openbravo.com>
Thu, 03 Mar 2011 16:42:03 +0100
changeset 10998 4ce71b93425e
parent 10997 eefc39001e3d
child 10999 a50368e901fb
Fixes issue 16113: DB Id shows in Financial Transaction add payment
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js	Thu Mar 03 16:28:50 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js	Thu Mar 03 16:42:03 2011 +0100
@@ -534,3 +534,14 @@
   
   OB.GlobalHiddenForm.submit();
 };
+
+// ** {{{ OB.Utilities.updateSmartClientComponentValue }}} **
+//
+// Updates the value of a smartclient component.
+//
+// Parameters:
+// * {{{input}}}: the input field (html dom input element)
+// * {{{component}}}: the Smartclient component (must have a setValue function)
+OB.Utilities.updateSmartClientComponentValue = function(/* Object */input, /* Object */ component){
+  component.setValue(input.value);
+};
--- a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js	Thu Mar 03 16:28:50 2011 +0100
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js	Thu Mar 03 16:42:03 2011 +0100
@@ -232,6 +232,14 @@
           changed = oldValue !== newValue;
           this.selector.openbravoField.value = newValue;
           this.selector.selectorField.setValue(newValue);
+          
+          // set the value in the valuemap so it shows up correctly without loading
+          // all the info again
+          if (!this.selector.selectorField.valueMap) {
+            this.selector.selectorField.valueMap = {};
+          }
+          this.selector.selectorField.valueMap[newValue] = selected[this.selector.displayField];
+          this.selector.selectorField.updateValueMap();
         } else {
           changed = oldValue !== '';
           this.selector.openbravoField.value = '';