[Lada-commits] [PATCH] Fix handling of errors and warnings in Ortserstellung form

Wald Commits scm-commit at wald.intevation.org
Tue Feb 7 18:25:36 CET 2017


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1486488318 -3600
# Node ID b96d98f0cb7159cef8f312e78bc2a108f84ffb0e
# Parent  81b5856455812b10fc140cc7fc01facbd0aea90d
Fix handling of errors and warnings in Ortserstellung form.

diff -r 81b585645581 -r b96d98f0cb71 app/controller/form/Ortserstellung.js
--- a/app/controller/form/Ortserstellung.js	Tue Feb 07 17:18:13 2017 +0100
+++ b/app/controller/form/Ortserstellung.js	Tue Feb 07 18:25:18 2017 +0100
@@ -99,11 +99,8 @@
 
             },
             failure: function(record, response) {
-                var json = Ext.decode(response.response.responseText);
+                var json = response.request.scope.reader.jsonData;
                 if (json) {
-                    if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){
-                        formPanel.setMessages(json.errors, json.warnings);
-                    }
                     if(json.message){
                         Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title')
                             +' #'+json.message,
@@ -112,11 +109,12 @@
                          Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
                              Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
                     }
+                    me.clearMessages();
+                    me.setMessages(json.errors, json.warnings);
                 } else {
                     Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
                         Lada.getApplication().bundle.getMsg('err.msg.response.body'));
                 }
-                me.setDisabled(true);
             }
         });
     },
diff -r 81b585645581 -r b96d98f0cb71 app/view/form/Ortserstellung.js
--- a/app/view/form/Ortserstellung.js	Tue Feb 07 17:18:13 2017 +0100
+++ b/app/view/form/Ortserstellung.js	Tue Feb 07 18:25:18 2017 +0100
@@ -39,7 +39,7 @@
             labelWidth: 125,
             value: Lada.netzbetreiber[0]
         }, {
-            xtype: 'textfield',
+            xtype: 'tfield',
             name: 'ortId',
             maxLength: 10,
             labelWidth: 125,


More information about the Lada-commits mailing list