[Dojo-interest] Changes in ValidationTextBox.validate() 1.5 caused an error

3 views
Skip to first unread message

Joanne Nguyen

unread,
Nov 30, 2010, 1:49:11 PM11/30/10
to dojo-i...@mail.dojotoolkit.org

Hi,

There seems to be a problem with the changes I saw in the
ValidationTextBox.validate() function in dojo 1.5. My application uses dojo
1.4.3 and there is no problem until I upgraded to dojo 1.5. What I have is
a StackContainer, on the first page, I have a ValidationTextBox and a
promtMessage set. When I click on the textbox, the tooltip shows my
promtMessage. I entered a value and hit next which goes to my next page.
The promptMessage tooltip shown up in some odd location on my second page.
What I see that is difference between the 2 level is in the validate
function below.

dojo 1.4.3 ValidationTextBox.validate() has this:
validate: function(/*Boolean*/ isFocused){
....
if(isFocused){
if(isEmpty){message = this.getPromptMessage(true);}
if(!message && (this.state == "Error" || (isValidSubset &&
!this._maskValidSubsetError))){
message = this.getErrorMessage(true);
}
}
this.displayMessage(message);
return isValid;
},

dojo 1.5 ValidationTextBox.validate() has this:
validate: function(/*Boolean*/ isFocused){
....
if(isFocused){
if(this.state == "Error"){
message = this.getErrorMessage(true);
}else{
message = this.getPromptMessage(true); // show the prompt whever
there's no error
}
}
this.displayMessage(message);
return isValid;
},

It seems that in 1.5, we will always show the promtMessage because there is
no checks. Isn't this wrong?

Thanks,
Joanne
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Changes-in-ValidationTextBox-validate-1-5-caused-an-error-tp1994403p1994403.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
Dojo-i...@mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

Bill Keese

unread,
Dec 12, 2010, 8:48:28 AM12/12/10
to dojo-i...@mail.dojotoolkit.org
It's supposed to show the prompt message when there's no error *and* when the widget is focused.    My guess is that you are switching to a new page but somehow your focus is still on the old ValidationTextBox widget. 
Reply all
Reply to author
Forward
0 new messages