details: /erp/devel/pi/rev/450e592411ca
changeset: 10666:450e592411ca
user: Antonio Moreno <antonio.moreno <at> openbravo.com>
date: Tue Feb 15 15:53:20 2011 +0100
summary: Wait until FIC calls have finished to save the form
details: /erp/devel/pi/rev/7393d8d7e4b1
changeset: 10667:7393d8d7e4b1
user: Antonio Moreno <antonio.moreno <at> openbravo.com>
date: Tue Feb 15 18:07:57 2011 +0100
summary: First part of force FIC calls when saving in the grid
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
| 28 +++++++--
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
| 20 +++++++
2 files changed, 41 insertions(+), 7 deletions(-)
diffs (97 lines):
diff -r 9806e834e4ff -r 7393d8d7e4b1
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
Tue Feb 15 17:38:20 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
Tue Feb 15 18:07:57 2011 +0100
@@ -362,6 +362,15 @@
// note onFieldChanged uses the form.readOnly set above
this.onFieldChanged(this);
this.focus();
+ delete this.inFicCall;
+ if (this.callSaveAfterFICReturn) {
+ delete this.callSaveAfterFICReturn;
+ this.saveRow(true);
+ }
+ if (this.actionAfterFicReturn) {
+ OB.Utilities.callAction(this.actionAfterFicReturn);
+ delete this.actionAfterFicReturn;
+ }
},
setDisabled: function(state) {
@@ -480,8 +489,9 @@
for (i = 0; i < this.dynamicCols.length; i++) {
if (this.dynamicCols[i] === item.inpColumnName) {
item._hasChanged = false;
+ this.inFicCall= true;
this.doChangeFICCall(item);
- return;
+ return true;
}
}
}
@@ -583,7 +593,7 @@
// there the save call is done through the grid saveEditedValues
// function
saveRow: function(){
- var i, length, flds, form = this;
+ var i, length, flds, form = this, ficCallDone;
var record = form.view.viewGrid.getSelectedRecord(), recordIndex =
form.view.viewGrid.getRecordIndex(record);
form.isSaving = true;
@@ -659,11 +669,15 @@
return;
}
- // last parameter true prevents additional validation
- this.saveData(callback, {
- willHandleError: true,
- formSave: true
- }, true);
+ if(this.inFicCall){
+ this.callSaveAfterFICReturn = true;
+ }else{
+ // last parameter true prevents additional validation
+ this.saveData(callback, {
+ willHandleError: true,
+ formSave: true
+ }, true);
+ }
},
// overridden to prevent focus setting when autoSaving
diff -r 9806e834e4ff -r 7393d8d7e4b1
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
Tue Feb 15 17:38:20 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
Tue Feb 15 18:07:57 2011 +0100
@@ -48,6 +48,7 @@
// Controls if an edit link column is created in the grid, set to false to
// prevent this.
editGrid: true,
+ updateEditorItemsInPlace: false,
// ** {{{ editLinkFieldProperties }}} **
// The properties of the ListGridField created for the edit links.
@@ -1716,6 +1717,25 @@
doCancel: function(){
this.grid.cancelEditing();
+ },
+
+ saveEdits : function (editCompletionEvent, callback, rowNum, colNum,
validateOnly, ficCallDone) {
+ isc.say('hola');
+ if(!ficCallDone){
+ if(this.getEditForm().getFocusItem() &&
this.getEditForm().handleItemChange(this.getEditForm().getFocusItem())){
+ arguments.push(true);
+ this.getEditForm().actionAfterFicReturn = {
+ target: this,
+ method: this.saveEdits,
+ parameters: arguments
+ }
+ }else{
+ this.Super('saveEdits', arguments);
+ }
+ return;
+ }else{
+ this.Super('saveEdits', arguments);
+ }
}
});
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits