changeset 1228:d5b9a5c75872

Enable validation for SetStatus window.
author Tom Gottfried <tom@intevation.de>
date Fri, 28 Oct 2016 13:43:06 +0200
parents 848b50a4a4eb
children eeed1b92341f
files app/view/window/SetStatus.js
diffstat 1 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/window/SetStatus.js	Thu Oct 27 19:52:29 2016 +0200
+++ b/app/view/window/SetStatus.js	Fri Oct 28 13:43:06 2016 +0200
@@ -31,7 +31,7 @@
         var i18n = Lada.getApplication().bundle;
         var me = this;
         this.items = [{
-            xtype: 'panel',
+            xtype: 'form',
             name: 'valueselection',
             border: 0,
             items: [{
@@ -64,6 +64,18 @@
                     fieldLabel: i18n.getMsg('statusgrid.header.text'),
                     emptyText: 'Geben Sie einen Kommentar ein.'
                 }]
+            }],
+            buttons: [{
+                text: i18n.getMsg('statusSetzen'),
+                name: 'start',
+                icon: 'resources/img/mail-mark-notjunk.png',
+                formBind: true,
+                disabled: true,
+                handler: this.setStatus
+            }, {
+                text: i18n.getMsg('cancel'),
+                name: 'abort',
+                handler: this.closeWindow
             }]
         }, {
             xtype: 'panel',
@@ -78,15 +90,6 @@
             text: 'Verarbeite Statusänderungen'
         }];
         this.buttons = [{
-            text: i18n.getMsg('statusSetzen'),
-            name: 'start',
-            icon: 'resources/img/mail-mark-notjunk.png',
-            handler: this.setStatus
-        }, {
-            text: i18n.getMsg('cancel'),
-            name: 'abort',
-            handler: this.closeWindow
-        }, {
             text: i18n.getMsg('close'),
             name: 'close',
             hidden: true,
@@ -94,6 +97,9 @@
         }];
 
         this.callParent(arguments);
+
+        // Initially validate to indicate mandatory fields clearly.
+        this.down('form').isValid();
     },
 
     /**

http://lada.wald.intevation.org