comparison app/controller/form/Location.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 d21048cbdbb3
children f0bc5387abcc
comparison
equal deleted inserted replaced
694:a0df1a8dff24 695:d6ef146e1a9f
59 button.up('toolbar').down('button[action=discard]') 59 button.up('toolbar').down('button[action=discard]')
60 .setDisabled(true); 60 .setDisabled(true);
61 formPanel.getForm().loadRecord(formPanel.getForm().getRecord()); 61 formPanel.getForm().loadRecord(formPanel.getForm().getRecord());
62 var json = response.request.scope.reader.jsonData; 62 var json = response.request.scope.reader.jsonData;
63 if (json) { 63 if (json) {
64 formPanel.setMessages(json.errors, json.warnings); 64 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){
65 formPanel.setMessages(json.errors, json.warnings);
66 }
67
68 if(json.message){
69 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('errmsgtitle')
70 +' '+json.message,
71 Lada.getApplication().bundle.getMsg(json.message));
72 }
65 } 73 }
66 } 74 }
67 }); 75 });
68 }, 76 },
69 77

http://lada.wald.intevation.org