Fixes issue 26011: Selector Out Field don't work in grid mode
authorAugusto Mauch <augusto.mauch@openbravo.com>
Thu, 20 Mar 2014 11:21:11 +0100
changeset 22734 a4bac660abf1
parent 22732 a368fe956596
child 22735 bebe124e664d
Fixes issue 26011: Selector Out Field don't work in grid mode

The problem was that the fields[j].setValue function was being used to apply store the value of the out fields, and that function is not available when the sel
ector is used in the grid view. To solve this, grid.setEditValue is used if the fields[j].setValue function is not available.
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	Tue Mar 18 17:31:42 2014 +0530
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js	Thu Mar 20 11:21:11 2014 +0100
@@ -715,7 +715,12 @@
               } else {
                 value = null;
               }
-              fields[j].setValue(value);
+              // fields[j].setValue will be used when the selector is used in form view, and grid.setEditValue when it is used in grid view
+              if (fields[j].setValue) {
+                fields[j].setValue(value);
+              } else {
+                grid.setEditValue(grid.getEditRow(), j, value);
+              }
             }
           }
         }