# HG changeset patch # User Torsten Irländer # Date 1370448279 -7200 # Node ID 4a82e28dfcc47d2a86234e5801e9d2870b48d2bc # Parent 5c58c0e8936b212cb66b9e7f3d4ceb1ec93cde75 Translate error codes and store them as attributes of the form diff -r 5c58c0e8936b -r 4a82e28dfcc4 app/view/widgets/LadaForm.js --- a/app/view/widgets/LadaForm.js Wed Jun 05 18:04:07 2013 +0200 +++ b/app/view/widgets/LadaForm.js Wed Jun 05 18:04:39 2013 +0200 @@ -18,6 +18,10 @@ bodyPadding: '10 10', border: 0, + errors: null, + warnings: null, + message: null, + initComponent: function() { this.callParent(); @@ -66,8 +70,10 @@ this.fireEvent('savesuccess', this, records, operation); } else { console.log('Save was not successfull'); - var errors = operation.request.scope.reader.jsonData["errors"]; - this.form.markInvalid(errors); + this.errors = this.translateReturnCodes(operation.request.scope.reader.jsonData["errors"]); + this.warnings = this.translateReturnCodes(operation.request.scope.reader.jsonData["warnings"]); + this.message = Lada.getApplication().bundle.getMsg(operation.request.scope.reader.jsonData["message"]); + this.form.markInvalid(this.errors); this.fireEvent('savefailure', this, records, operation); } if (callback) {