[Lada-commits] [PATCH 5 of 9] Added simple handling for Failure-Messages
Wald Commits
scm-commit at wald.intevation.org
Thu Mar 26 17:31:47 CET 2015
# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1427383453 -3600
# Node ID d6ef146e1a9fe39cb9f036c5a83a9634b99a6016
# Parent a0df1a8dff2446fbc4118a0d638808b0a59d2ec8
Added simple handling for Failure-Messages
diff -r a0df1a8dff24 -r d6ef146e1a9f app/controller/form/Location.js
--- a/app/controller/form/Location.js Thu Mar 26 16:02:38 2015 +0100
+++ b/app/controller/form/Location.js Thu Mar 26 16:24:13 2015 +0100
@@ -61,7 +61,15 @@
formPanel.getForm().loadRecord(formPanel.getForm().getRecord());
var json = response.request.scope.reader.jsonData;
if (json) {
- formPanel.setMessages(json.errors, json.warnings);
+ 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('errmsgtitle')
+ +' '+json.message,
+ Lada.getApplication().bundle.getMsg(json.message));
+ }
}
}
});
diff -r a0df1a8dff24 -r d6ef146e1a9f app/controller/form/Messung.js
--- a/app/controller/form/Messung.js Thu Mar 26 16:02:38 2015 +0100
+++ b/app/controller/form/Messung.js Thu Mar 26 16:24:13 2015 +0100
@@ -62,7 +62,9 @@
}
if(json.message){
- Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle'), Lada.getApplication().bundle.getMsg(json.message));
+ Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle')
+ +' '+json.message,
+ Lada.getApplication().bundle.getMsg(json.message));
}
}
}
diff -r a0df1a8dff24 -r d6ef146e1a9f app/controller/form/Ort.js
--- a/app/controller/form/Ort.js Thu Mar 26 16:02:38 2015 +0100
+++ b/app/controller/form/Ort.js Thu Mar 26 16:24:13 2015 +0100
@@ -52,7 +52,15 @@
formPanel.getForm().loadRecord(formPanel.getForm().getRecord());
var json = response.request.scope.reader.jsonData;
if (json) {
- formPanel.setMessages(json.errors, json.warnings);
+ 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('errmsgtitle')
+ +' '+json.message,
+ Lada.getApplication().bundle.getMsg(json.message));
+ }
}
}
});
More information about the Lada-commits
mailing list