when using a text box and a value is required or regEx is defined, use a ValidationT...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 9 Jun 2009 21:35:09 +0000 (21:35 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 9 Jun 2009 21:35:09 +0000 (21:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13356 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js

index c280466..a5dd13a 100644 (file)
@@ -177,8 +177,13 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
                         if(this._buildLinkSelector()) break;
 
                     default:
-                        dojo.require('dijit.form.TextBox');
-                        this.widget = new dijit.form.TextBox(this.dijitArgs, this.parentNode);
+                        if(this.dijitArgs && (this.dijitArgs.required || this.dijitArgs.regExp)) {
+                            dojo.require('dijit.form.ValidationTextBox');
+                            this.widget = new dijit.form.ValidationTextBox(this.dijitArgs, this.parentNode);
+                        } else {
+                            dojo.require('dijit.form.TextBox');
+                            this.widget = new dijit.form.TextBox(this.dijitArgs, this.parentNode);
+                        }
                 }
             }