You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Al Maw <wi...@almaw.com> on 2007/07/06 20:42:23 UTC

Nonsensical default validation messages

The current default validation messages in Application.properties make 
no logical sense.

At the moment, if you put in a value that is larger than a 
NumberValidator maximum it says:

"5 must be smaller than 3"

Which it can't be, not even for very small values of 5.

To fix this, we need to do one of the following two things:

1. Change ${input} to ${label}, in which case they would all make sense.

2. Change the text so it actually makes sense in the context of ${input}
    as in the attached patch. e.g. "5 is larger than 3.", which would
    at least tell you what's currently wrong with it.

I appreciate the argument that people don't call setLabel() when they 
should do, but the current set-up isn't nice.

Thoughts?

Regards,

Al

-- 
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

Re: Nonsensical default validation messages

Posted by Charlie Dobbie <cf...@gmail.com>.
Looks like the Javadoc suffers from the same issue - certainly on
1.2.5, and it looks like in 1.2.x svn as well.



On 7/12/07, Ryan Holmes <ry...@hyperstep.com> wrote:
> As long as you're fixing those messages, I think they have a couple
> of other problems (I'm using 1.2, but it looks like 1.3 has the same
> issues).
>
> First, both messages are off by one . When you create a
> MaximumValidator with a value of 3, the value is inclusive so 3 is a
> valid input. But the message says '5 must be *smaller than* 3', which
> doesn't include 3 itself. It should read "5 must not be greater than
> 3" or something along those lines.

Re: Nonsensical default validation messages

Posted by Ryan Holmes <ry...@hyperstep.com>.
As long as you're fixing those messages, I think they have a couple  
of other problems (I'm using 1.2, but it looks like 1.3 has the same  
issues).

First, both messages are off by one . When you create a  
MaximumValidator with a value of 3, the value is inclusive so 3 is a  
valid input. But the message says '5 must be *smaller than* 3', which  
doesn't include 3 itself. It should read "5 must not be greater than  
3" or something along those lines.

The second point is minor, but "greater" and "smaller" are kind of  
lopsided antonyms. "Bigger/smaller" or "greater/less" would be more  
in sync. Something like this:

NumberValidator.minimum='${label}' must not be less than ${minimum}.
NumberValidator.maximum='${label}' must not be greater than ${maximum}.

Thanks,
-Ryan

On Jul 6, 2007, at 11:42 AM, Al Maw wrote:

>
> The current default validation messages in Application.properties  
> make no logical sense.
>
> At the moment, if you put in a value that is larger than a  
> NumberValidator maximum it says:
>
> "5 must be smaller than 3"
>
> Which it can't be, not even for very small values of 5.
>
> To fix this, we need to do one of the following two things:
>
> 1. Change ${input} to ${label}, in which case they would all make  
> sense.
>
> 2. Change the text so it actually makes sense in the context of $ 
> {input}
>    as in the attached patch. e.g. "5 is larger than 3.", which would
>    at least tell you what's currently wrong with it.
>
> I appreciate the argument that people don't call setLabel() when  
> they should do, but the current set-up isn't nice.
>
> Thoughts?
>
> Regards,
>
> Al
>
> -- 
> Alastair Maw
> Wicket-biased blog at http://herebebeasties.com
> Index: /home/almaw/svn/wicket/wicket-1.x/jdk-1.4/wicket/src/main/ 
> java/org/apache/wicket/Application.properties
> ===================================================================
> --- /home/almaw/svn/wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/ 
> org/apache/wicket/Application.properties	(revision 553981)
> +++ /home/almaw/svn/wicket/wicket-1.x/jdk-1.4/wicket/src/main/java/ 
> org/apache/wicket/Application.properties	(working copy)
> @@ -15,18 +15,18 @@
>  Required=Field '${label}' is required.
>  IConverter='${input}' is not a valid ${type}.
>
> -NumberValidator.range=${input} must be between ${minimum} and $ 
> {maximum}.
> -NumberValidator.minimum='${input}' must be greater than ${minimum}.
> -NumberValidator.maximum='${input}' must be smaller than ${maximum}.
> +NumberValidator.range=${input} is not between ${minimum} and $ 
> {maximum}.
> +NumberValidator.minimum='${input}' is smaller than ${minimum}.
> +NumberValidator.maximum='${input}' is larger than ${maximum}.
>
> -StringValidator.range='${input}' must be between ${minimum} and $ 
> {maximum} characters.
> -StringValidator.minimum='${input}' must be at least ${minimum}  
> characters.
> -StringValidator.maximum='${input}' must be at most ${maximum}  
> characters.
> -StringValidator.exact='${input}' must be ${exact} characters long.
> +StringValidator.range='${input}' is not between ${minimum} and $ 
> {maximum} characters.
> +StringValidator.minimum='${input}' is less than ${minimum}  
> characters.
> +StringValidator.maximum='${input}' is more than ${maximum}  
> characters.
> +StringValidator.exact='${input}' is not exactly ${exact}  
> characters long.
>
> -DateValidator.range='${input}' must be between ${minimum} and $ 
> {maximum}.
> -DateValidator.minimum='${input}' must be greater than ${minimum}.
> -DateValidator.maximum='${input}' must be smaller than ${maximum}.
> +DateValidator.range='${input}' is not between ${minimum} and $ 
> {maximum}.
> +DateValidator.minimum='${input}' is less than ${minimum}.
> +DateValidator.maximum='${input}' is larger than ${maximum}.
>


Re: Nonsensical default validation messages

Posted by Martijn Dashorst <ma...@gmail.com>.
I'm on the subject in the book, so I need an answer now. Are we or aren't we?

pro: better feedback
con: need to acquire new feedback resource bundles for all languages.

I'm 0 on the issue, but do need a decision quickly. The solution may
follow later.

> I appreciate the argument that people don't call setLabel() when they
> should do, but the current set-up isn't nice.

What do you propose to mitigate this then? Default to component id? or
input? or throw a BigFuglyException?

Martijn

On 7/6/07, Igor Vaynberg <ig...@gmail.com> wrote:
> On 7/6/07, Al Maw <wi...@almaw.com> wrote:
> >
> >
> > The current default validation messages in Application.properties make
> > no logical sense.
> >
> > At the moment, if you put in a value that is larger than a
> > NumberValidator maximum it says:
> >
> > "5 must be smaller than 3"
> >
> > Which it can't be, not even for very small values of 5.
> >
> > To fix this, we need to do one of the following two things:
> >
> > 1. Change ${input} to ${label}, in which case they would all make sense.
> >
> > 2. Change the text so it actually makes sense in the context of ${input}
> >     as in the attached patch. e.g. "5 is larger than 3.", which would
> >     at least tell you what's currently wrong with it.
> >
> > I appreciate the argument that people don't call setLabel() when they
> > should do, but the current set-up isn't nice.
> >
> > Thoughts?
>
>
>
> i have always advocated switching to ${label} exactly for these reasons, and
> would still like to see it done.
>
> -igor
>
>
>
> Regards,
> >
> > Al
> >
> > --
> > Alastair Maw
> > Wicket-biased blog at http://herebebeasties.com
> >
> >
>


-- 
Wicket joins the Apache Software Foundation as Apache Wicket
Apache Wicket 1.3.0-beta2 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta2/

Re: Nonsensical default validation messages

Posted by Igor Vaynberg <ig...@gmail.com>.
On 7/6/07, Al Maw <wi...@almaw.com> wrote:
>
>
> The current default validation messages in Application.properties make
> no logical sense.
>
> At the moment, if you put in a value that is larger than a
> NumberValidator maximum it says:
>
> "5 must be smaller than 3"
>
> Which it can't be, not even for very small values of 5.
>
> To fix this, we need to do one of the following two things:
>
> 1. Change ${input} to ${label}, in which case they would all make sense.
>
> 2. Change the text so it actually makes sense in the context of ${input}
>     as in the attached patch. e.g. "5 is larger than 3.", which would
>     at least tell you what's currently wrong with it.
>
> I appreciate the argument that people don't call setLabel() when they
> should do, but the current set-up isn't nice.
>
> Thoughts?



i have always advocated switching to ${label} exactly for these reasons, and
would still like to see it done.

-igor



Regards,
>
> Al
>
> --
> Alastair Maw
> Wicket-biased blog at http://herebebeasties.com
>
>

Re: Nonsensical default validation messages

Posted by Jonathan Locke <jo...@gmail.com>.

this may not repro in some US locales like kansas, oklahoma or alabama.


Al Maw wrote:
> 
> 
> "5 must be smaller than 3"
> 
> Which it can't be, not even for very small values of 5.
> Thoughts?
> 
> 

-- 
View this message in context: http://www.nabble.com/Nonsensical-default-validation-messages-tf4037481.html#a11727731
Sent from the Wicket - Dev mailing list archive at Nabble.com.