comparison app/view/widget/base/TextField.js @ 634:291ac2e2bcf5

Set translateable messages for the parent fieldset.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 16 Mar 2015 17:31:13 +0100
parents fead63bb5fb4
children 40834912929e
comparison
equal deleted inserted replaced
633:1e1534482bfd 634:291ac2e2bcf5
52 img.show(); 52 img.show();
53 this.down('textfield').invalidCls = 'x-lada-warning'; 53 this.down('textfield').invalidCls = 'x-lada-warning';
54 this.down('textfield').markInvalid(''); 54 this.down('textfield').markInvalid('');
55 var fieldset = this.up('fieldset[collapsible=true]'); 55 var fieldset = this.up('fieldset[collapsible=true]');
56 if (fieldset) { 56 if (fieldset) {
57 fieldset.showWarnings(warnings); 57 var i18n = Lada.getApplication().bundle;
58 var warningText = i18n.getMsg(this.name) + ': ' + warnings;
59 fieldset.showWarningOrError(true, warningText);
58 } 60 }
59 }, 61 },
60 62
61 showErrors: function(errors) { 63 showErrors: function(errors) {
62 var img = this.down('image[name=errorImg]'); 64 var img = this.down('image[name=errorImg]');
69 this.down('textfield').invalidCls = 'x-lada-error'; 71 this.down('textfield').invalidCls = 'x-lada-error';
70 this.down('textfield').markInvalid(''); 72 this.down('textfield').markInvalid('');
71 img.show(); 73 img.show();
72 var fieldset = this.up('fieldset[collapsible=true]'); 74 var fieldset = this.up('fieldset[collapsible=true]');
73 if (fieldset) { 75 if (fieldset) {
74 fieldset.showErrors(); 76 var i18n = Lada.getApplication().bundle;
77 var errorText = i18n.getMsg(this.name) + ': ' + errors;
78 fieldset.showWarningOrError(false, '', true, errorText);
75 } 79 }
76 }, 80 },
77 81
78 clearWarningOrError: function() { 82 clearWarningOrError: function() {
79 this.down('image[name=errorImg]').hide(); 83 this.down('image[name=errorImg]').hide();

http://lada.wald.intevation.org