Mercurial > lada > lada-client
comparison app/controller/form/Ort.js @ 695:d6ef146e1a9f
Added simple handling for Failure-Messages
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Thu, 26 Mar 2015 16:24:13 +0100 |
parents | 71e8b84d7829 |
children | f0bc5387abcc |
comparison
equal
deleted
inserted
replaced
694:a0df1a8dff24 | 695:d6ef146e1a9f |
---|---|
50 button.up('toolbar').down('button[action=discard]') | 50 button.up('toolbar').down('button[action=discard]') |
51 .setDisabled(true); | 51 .setDisabled(true); |
52 formPanel.getForm().loadRecord(formPanel.getForm().getRecord()); | 52 formPanel.getForm().loadRecord(formPanel.getForm().getRecord()); |
53 var json = response.request.scope.reader.jsonData; | 53 var json = response.request.scope.reader.jsonData; |
54 if (json) { | 54 if (json) { |
55 formPanel.setMessages(json.errors, json.warnings); | 55 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){ |
56 formPanel.setMessages(json.errors, json.warnings); | |
57 } | |
58 | |
59 if(json.message){ | |
60 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle') | |
61 +' '+json.message, | |
62 Lada.getApplication().bundle.getMsg(json.message)); | |
63 } | |
56 } | 64 } |
57 } | 65 } |
58 }); | 66 }); |
59 }, | 67 }, |
60 | 68 |