details: https://code.openbravo.com/erp/devel/pi/rev/37c4fa35d678 changeset: 25475:37c4fa35d678 user: Augusto Mauch <augusto.mauch <at> openbravo.com> date: Mon Dec 01 10:47:31 2014 +0100 summary: Related with issue 28188: Grid error handling is more homogeneous than before
This note [1] described four cases where the handling of validation errors detected in the front end was different thant the handling of validation errors detected in the back end. These three cases have been fixed by the present changeset: - 7. Cancel changes button is enabled when selecting several problematic errors, being possible to cancel changes for all of them at the same time - 8. Popup appears when navigating to another tab to notify the user about the erroneous state - 9. Record contextual menu (mouse right click) includes "Cancel changes" option. The mechanism to handle these cases was already in place, but was not working properly because: - The OBViewGrid.ERROR_MESSAGE_PROP attribute was undefined. It has been undefined since the ob-view-grid.js file was created. Probably it had a value when the contents of ob-view-grid.js were stored in another filed and they were not copied to the new file. This property is set when it is detected that a row has a validation error and then it is checked in the OBViewGrid.hasError function. - The OBViewGrid.hasError function was not working properly when the validation errors were detected in the backend. It was returning false if the grid was not currently being edited, so it was not reaching the point where the OBViewGrid.ERROR_MESSAGE_PROP attribute of the saved row was checked. The code that has been removed was used to fix this issue [2], which remains fixed even with those lines deleted. [1] https://issues.openbravo.com/view.php?id=28188#c72137 [2] https://issues.openbravo.com/view.php?id=17377 details: https://code.openbravo.com/erp/devel/pi/rev/a57ac42b2bec changeset: 25476:a57ac42b2bec user: Augusto Mauch <augusto.mauch <at> openbravo.com> date: Mon Dec 01 12:06:50 2014 +0100 summary: Fixes bug 28188:Grid client-side and backend-side error handling is homogeneous This changeset fixes the last case where the error handling of client-side and backend-side was not homogeneous: - 4. Error message is shown in the message bar when navigating to Price subtab To fix this, an error message is shown in the message bar when the backend validation error is detected after autosaving. diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diffs (33 lines): diff -r 7061822cce38 -r a57ac42b2bec modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Mon Dec 01 15:50:26 2014 +0530 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Mon Dec 01 12:06:50 2014 +0100 @@ -25,7 +25,7 @@ // ListGrid._$ArrowUp and ListGrid._$ArrowDown ARROW_UP_KEY_NAME: 'Arrow_Up', ARROW_DOWN_KEY_NAME: 'Arrow_Down', - ERROR_MESSAGE_PROP: isc.OBViewGrid.ERROR_MESSAGE_PROP, + ERROR_MESSAGE_PROP: '_hasErrors', ICONS: { PROGRESS: 0, OPEN_IN_FORM: 1, @@ -2910,6 +2910,10 @@ isc.warn(OB.I18N.getLabel('OBUIAPP_AutoSaveError', [this.view.tabTitle])); } + // show an error message in the toolbar if the event that triggered the action was an autosave, to mimic the way client side validation errors are handled + if (view.standardWindow.isAutoSaving) { + view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_ErrorInFieldsGrid', [view.ID])); + } view.standardWindow.cleanUpAutoSaveProperties(); view.updateTabTitle(); view.toolBar.updateButtonState(true); @@ -3691,9 +3695,6 @@ if (this.Super('rowHasErrors', arguments)) { return true; } - if (!this.getEditForm()) { - return false; - } if (this.getEditRow() === rowNum && this.getEditForm().hasErrors()) { return true; } ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
