[Lada-commits] [PATCH 3 of 3] Fix for ErrorMessages in FieldSets for IE8 IE9

Wald Commits scm-commit at wald.intevation.org
Wed Apr 15 18:39:53 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1429115663 -7200
# Node ID c2a6f7caa71b7af9fb20d752c00558245c1c7dda
# Parent  5e91a740aff8da4bd8bbfc5e5e9ad6f5ef6f2847
Fix for ErrorMessages in FieldSets for IE8 IE9

diff -r 5e91a740aff8 -r c2a6f7caa71b app/controller/form/Messung.js
--- a/app/controller/form/Messung.js	Wed Apr 15 16:20:44 2015 +0200
+++ b/app/controller/form/Messung.js	Wed Apr 15 18:34:23 2015 +0200
@@ -80,7 +80,12 @@
                          Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
                             Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
                     }
-                }
+                    formPanel.clearMessages();
+                    formPanel.setRecord(record);
+                    formPanel.setMessages(json.errors, json.warnings);
+                    formPanel.up('window').initData();
+                    formPanel.up('window').grid.store.reload();
+                  }
                 else {
                     Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
                         Lada.getApplication().bundle.getMsg('err.msg.response.body'));
diff -r 5e91a740aff8 -r c2a6f7caa71b app/controller/form/Probe.js
--- a/app/controller/form/Probe.js	Wed Apr 15 16:20:44 2015 +0200
+++ b/app/controller/form/Probe.js	Wed Apr 15 18:34:23 2015 +0200
@@ -73,10 +73,14 @@
                          Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.save.title'),
                             Lada.getApplication().bundle.getMsg('err.msg.generic.body'));
                     }
+                    formPanel.clearMessages();
+                    formPanel.setRecord(record);
+                    formPanel.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'));
                 }
+
             }
         });
     },
diff -r 5e91a740aff8 -r c2a6f7caa71b app/view/form/Probe.js
--- a/app/view/form/Probe.js	Wed Apr 15 16:20:44 2015 +0200
+++ b/app/view/form/Probe.js	Wed Apr 15 18:34:23 2015 +0200
@@ -100,6 +100,7 @@
                         items: [{
                             xtype: 'fset',
                             title: 'Erweiterte Angaben',
+                            name: 'erwAngaben',
                             collapsible: true,
                             collapsed: true,
                             items: [{
@@ -350,6 +351,7 @@
         this.down('datetime[name=solldatumBeginn]').clearWarningOrError();
         this.down('datetime[name=solldatumEnde]').clearWarningOrError();
         //this.down('numberfield[name=probeNehmerId]').clearWarningOrError();
+        this.down('fset[name=erwAngaben]').clearMessages();
         this.down('fset[name=entnahmePeriod]').clearMessages();
         this.down('fset[name=sollzeitPeriod]').clearMessages();
     },
diff -r 5e91a740aff8 -r c2a6f7caa71b app/view/widget/base/FieldSet.js
--- a/app/view/widget/base/FieldSet.js	Wed Apr 15 16:20:44 2015 +0200
+++ b/app/view/widget/base/FieldSet.js	Wed Apr 15 18:34:23 2015 +0200
@@ -18,10 +18,6 @@
 
     showWarningOrError: function(warning, warningText, error, errorText) {
         this.clearMessages(); //Clear Errors and Warning first
-        var ndx = 0;
-        if (this.collapsible === true) {
-            ndx = 1;
-        }
         if (this.errorText && this.errorText !== '') {
             this.errorText += '\n';
         }
@@ -30,20 +26,17 @@
             this.warningText += '\n';
         }
         this.warningText += warningText;
-        this.plainTitle = this.getEl().dom.firstChild
-            .firstChild.firstChild
-            .children[ndx].innerHTML;
+        this.plainTitle = this.title;
         this.origColor = this.getEl().dom.style['border-color'];
+        var imgId = Ext.id();
         if (error) {
             this.getEl().dom.style['border-color'] = '#FF0000';
-            this.getEl().dom.firstChild.firstChild.firstChild
-                .children[ndx].innerHTML =
-                    '<img src="resources/img/emblem-important.png" width="13" height="13" />  ' +
-                    this.plainTitle;
+            this.setTitle('<img src="resources/img/emblem-important.png" width="13" height="13" id="'+ imgId +'"/>  '+
+                    this.plainTitle);
             if (errorText) {
                 if (!this.tooltip) {
                     Ext.create('Ext.tip.ToolTip', {
-                        target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx],
+                        target: imgId,
                         html: errorText
                     });
                 }
@@ -55,16 +48,15 @@
         }
         if (warning) {
             this.getEl().dom.style['border-color'] = '#FFE25D';
-            this.getEl().dom.firstChild.firstChild.firstChild
-                .children[ndx].innerHTML =
-                    '<img src="resources/img/dialog-warning.png" width="13" height="13" />  ' +
-                    this.plainTitle;
+            this.setTitle('<img src="resources/img/dialog-warning.png" width="13" height="13"  id="'+ imgId +'"/>  '+
+                    this.plainTitle);
             if (warningText) {
                 if (!this.tooltip) {
                     Ext.create('Ext.tip.ToolTip', {
-                        target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx],
+                        target: Ext.get(imgId),
                         html: warningText
                     });
+                debugger;
                 }
                 else {
                     tooltip.html = warningText;
@@ -75,14 +67,8 @@
     },
 
     clearMessages: function() {
-        var ndx = 0;
-        if (this.collapsible === true) {
-            ndx = 1;
-        }
         if (this.plainTitle !== '') {
-            this.getEl().dom.firstChild
-                .firstChild.firstChild
-                .children[ndx].innerHTML = this.plainTitle;
+            this.setTitle(this.plainTitle);
             this.getEl().dom.style['border-color'] = this.origColor;
         }
     }


More information about the Lada-commits mailing list