Solved an issue with wrong display of search item values
authorMartin Taal <martin.taal@openbravo.com>
Wed, 12 Jan 2011 19:10:19 +0100
changeset 9740 10d2fcbef85a
parent 9739 af7242b4c37c
child 9741 12c75172b2ff
Solved an issue with wrong display of search item values
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js	Wed Jan 12 19:09:37 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js	Wed Jan 12 19:10:19 2011 +0100
@@ -66,8 +66,14 @@
 function closeSearch(action, value, display, parameters, wait){
   var length, i, hiddenInputName, targetFld = isc.OBSearchItem.openSearchItem;
   if (action === 'SAVE') {
+    if (!targetFld.valueMap) {
+      targetFld.valueMap = {};
+    }
+    
     targetFld.setValue(value);
+    targetFld.valueMap[targetFld.getValue()] = display;
     targetFld.form.setValue(targetFld.displayField, display);
+    targetFld.updateValueMap(true);
     
     if (parameters && parameters.length > 0) {
       length = parameters.length;
@@ -277,13 +283,13 @@
   // visual state of disabled or non-disabled stays the same now
   showDisabled: false,
   
-  initWidget: function() {
+  initWidget: function(){
     var ret = this.Super('initWidget', arguments);
     return ret;
   },
   
-  updateDisabled: function() {
-      var ret = this.Super('initWidget', arguments);
+  updateDisabled: function(){
+    var ret = this.Super('initWidget', arguments);
     return ret;
   },