From 4871bd2b4f385eb76490ae36f4c9e700faf6a204 Mon Sep 17 00:00:00 2001 From: marcelo Date: Fri, 12 Apr 2013 10:47:05 -0400 Subject: [PATCH 1/5] BUG 11086 "Rows are being ignored after adding them next to an empty row" SOLVED -When you try to add a row into a pmTable, if you leave an empty row the next added rows are being ignored and not saved. -Solved, The final user cant leave a row without at least the primary keys columns filled up, to be saved. --- workflow/engine/templates/pmTables/data.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index 2107a9376..1d243f4ee 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -89,6 +89,11 @@ Ext.onReady(function(){ _fields.push({name: _idProperty}); for (i=0;i Date: Mon, 15 Apr 2013 10:35:12 -0400 Subject: [PATCH 2/5] BUG 11086 "Rows are being ignored after adding them next to an empty row" SOLVED -When you try to add a row into a pmTable, if you leave an empty row the next added rows are being ignored and not saved. -Solved, The final user cant leave a row without at least the primary keys columns filled up, to be saved and if by accident the user leaves an empty row the aplication shows up an error message. --- workflow/engine/templates/pmTables/data.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index 1d243f4ee..8f76d74c2 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -188,7 +188,8 @@ Ext.onReady(function(){ editor = new Ext.ux.grid.RowEditor({ saveText : _("ID_UPDATE"), listeners : { - + beforeedit:function(){ + } } }); } @@ -213,10 +214,10 @@ Ext.onReady(function(){ return false; - PMExt.error(_('ID_ERROR'), msg); + PMExt.error(_('ID_ERROR'), msg); infoGrid.store.reload(); }); - + E var proxy = new Ext.data.HttpProxy({ //url: '../pmTablesProxy/getData?id=' + tableDef.ADD_TAB_UID api: { @@ -397,12 +398,17 @@ NewPMTableRow = function(){ var row = new PMRow(new props); len = infoGrid.getStore().data.length; + if (infoGrid.store.getAt(len-1).data[tableDef.FIELDS[0].FLD_NAME]=="") { + PMExt.error( _('ID_ERROR'), _('ID_EMPTY_ROW')); + store.load(); + } else{ - editor.stopEditing(); - store.insert(len, row); - infoGrid.getView().refresh(); - infoGrid.getSelectionModel().selectRow(len); - editor.startEditing(len); + editor.stopEditing(); + store.insert(len, row); + infoGrid.getView().refresh(); + infoGrid.getSelectionModel().selectRow(len); + editor.startEditing(len); + } }; //Load PM Table Edition Row Form From d7eac27fb5e83bc728c0f2183b7e024d1c5360ba Mon Sep 17 00:00:00 2001 From: marcelo Date: Mon, 15 Apr 2013 15:00:06 -0400 Subject: [PATCH 3/5] BUG 11086 "Rows are being ignored after adding them next to an empty row" SOLVED -When you try to add a row into a pmTable, if you leave an empty row the next added rows are being ignored and not saved. -Solved, The final user cant leave a row without at least the primary keys columns filled up, to be saved and if by accident the user leaves an empty row the aplication shows up an error message. --- workflow/engine/templates/pmTables/data.js | 1 - 1 file changed, 1 deletion(-) diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index 8f76d74c2..0d5fba342 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -217,7 +217,6 @@ Ext.onReady(function(){ PMExt.error(_('ID_ERROR'), msg); infoGrid.store.reload(); }); - E var proxy = new Ext.data.HttpProxy({ //url: '../pmTablesProxy/getData?id=' + tableDef.ADD_TAB_UID api: { From 9bc2c87bd072269896e66075ac38ba72f7c02129 Mon Sep 17 00:00:00 2001 From: marcelo Date: Mon, 15 Apr 2013 15:22:30 -0400 Subject: [PATCH 4/5] BUG 11086 "Rows are being ignored after adding them next to an empty row" SOLVED -When you try to add a row into a pmTable, if you leave an empty row the next added rows are being ignored and not saved. -Solved, The final user cant leave a row without at least the primary keys columns filled up, to be saved and if by accident the user leaves an empty row the aplication shows up an error message. --- workflow/engine/templates/pmTables/data.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index 0d5fba342..64a207037 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -397,11 +397,18 @@ NewPMTableRow = function(){ var row = new PMRow(new props); len = infoGrid.getStore().data.length; - if (infoGrid.store.getAt(len-1).data[tableDef.FIELDS[0].FLD_NAME]=="") { - PMExt.error( _('ID_ERROR'), _('ID_EMPTY_ROW')); - store.load(); + if (len>0) { + if (infoGrid.store.getAt(len-1).data[tableDef.FIELDS[0].FLD_NAME]=="") { + PMExt.error( _('ID_ERROR'), _('ID_EMPTY_ROW')); + store.load(); + } else{ + editor.stopEditing(); + store.insert(len, row); + infoGrid.getView().refresh(); + infoGrid.getSelectionModel().selectRow(len); + editor.startEditing(len); + } } else{ - editor.stopEditing(); store.insert(len, row); infoGrid.getView().refresh(); From 82425aad5a430056e0804db0530bc509c99b1867 Mon Sep 17 00:00:00 2001 From: marcelo Date: Mon, 15 Apr 2013 16:06:15 -0400 Subject: [PATCH 5/5] BUG 11086 "Rows are being ignored after adding them next to an empty row" SOLVED -When you try to add a row into a pmTable, if you leave an empty row the next added rows are being ignored and not saved. -Solved, The final user cant leave a row without at least the primary keys columns filled up, to be saved and if by accident the user leaves an empty row the aplication shows up an error message. --- workflow/engine/templates/pmTables/data.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index 64a207037..b2976e40e 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -398,7 +398,13 @@ NewPMTableRow = function(){ var row = new PMRow(new props); len = infoGrid.getStore().data.length; if (len>0) { - if (infoGrid.store.getAt(len-1).data[tableDef.FIELDS[0].FLD_NAME]=="") { + var emptyrow=0; + for (var i = 0; i < tableDef.FIELDS.length; i++) { + if (infoGrid.store.getAt(len-1).data[tableDef.FIELDS[i].FLD_NAME]=="") { + emptyrow++; + }; + }; + if (emptyrow==tableDef.FIELDS.length) { PMExt.error( _('ID_ERROR'), _('ID_EMPTY_ROW')); store.load(); } else{