details:   https://code.openbravo.com/erp/devel/pi/rev/d322cce147e5
changeset: 20167:d322cce147e5
user:      Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date:      Mon Apr 22 16:13:01 2013 +0530
summary:   Related to Issue 0020587: [Pick&Execute] Mandatory column validation 
is not working

Added validations to resolve error in parameter windows without grid.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
 |  36 +++++-----
 1 files changed, 18 insertions(+), 18 deletions(-)

diffs (47 lines):

diff -r 6d253677f642 -r d322cce147e5 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
      Fri Apr 19 15:14:43 2013 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
      Mon Apr 22 16:13:01 2013 +0530
@@ -56,25 +56,25 @@
     // Buttons
 
     function actionClick() {
+      var hasErrors = false,
+          grid, fields, selection, len, allRows, lineNumbers, i, j, record, 
undef;
       view.messageBar.hide();
-      var hasErrors = false,
-          grid = view.grid.viewGrid,
-          fields = grid.getFields(),
-          selection = grid.getSelectedRecords() || [],
-          len = selection.length,
-          allRows = grid.data.allRows || grid.data.localData || grid.data,
-          lineNumbers = null,
-          i, j, record, undef;
-      for (i = 0; i < len; i++) {
-        record = grid.getEditedRecord(grid.getRecordIndex(selection[i]));
-        for (j = 0; j < fields.length; j++) {
-          if (fields[j].required) {
-            if (record[fields[j].name] === null || record[fields[j] === 
undef]) {
-              hasErrors = true;
-              if (lineNumbers === null) {
-                lineNumbers = grid.getRecordIndex(selection[i]).toString();
-              } else {
-                lineNumbers = lineNumbers + "," + 
grid.getRecordIndex(selection[i]).toString();
+      if (view.grid && view.grid.viewGrid) {
+        grid = view.grid.viewGrid;
+        fields = grid.getFields();
+        selection = grid.getSelectedRecords() || [];
+        len = selection.length, allRows = grid.data.allRows || 
grid.data.localData || grid.data;
+        for (i = 0; i < len; i++) {
+          record = grid.getEditedRecord(grid.getRecordIndex(selection[i]));
+          for (j = 0; j < fields.length; j++) {
+            if (fields[j].required) {
+              if (record[fields[j].name] === null || record[fields[j] === 
undef]) {
+                hasErrors = true;
+                if (lineNumbers === undef) {
+                  lineNumbers = grid.getRecordIndex(selection[i]).toString();
+                } else {
+                  lineNumbers = lineNumbers + "," + 
grid.getRecordIndex(selection[i]).toString();
+                }
               }
             }
           }

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to