From 0d887cd25ca901b403106419b8ee5ecb8326aff3 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 9 Jun 2009 21:35:09 +0000 Subject: [PATCH] when using a text box and a value is required or regEx is defined, use a ValidationTextBox instead 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index c280466048..a5dd13a409 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -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); + } } } -- 2.11.0