at least getting messages like:

int1 must be greater then 10
int2 must be less then 5

is better then

7 must be greater then 10
7 must be less then 5

i guess the question is whether or not the default messages we provide depend on the ${label} attr. maybe we should have a vote and see what the users want.

-Igor


On 4/20/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
i think it is the other way around
By default when you don't have labels (because that is not required anyhow) the default messages would be useless because you get id's prompted to the output.

What we should do then somehow is if a label IS specified we default to a label message
if it is not specified we default to give the input.

johan



On 4/20/06, Igor Vaynberg <[EMAIL PROTECTED] > wrote:
i agree, we should be using label by default. good catch ingram.

when building forms and wanting to use default error messages you should specify the label of the form components. thats why the damn ${label} tag is there in the first place!

i think to me, and everyone who does use label, the default messages are useless.

-Igor



On 4/20/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
but if we don't use input but label everywhere by default then a label must be really specified
Because i really don't know when i get
'myTextField' must be at most 12 chars
or
'datefieldX' smaller than 2004/01/01.

What is myTextfield or datefieldX. Is it always one on one or is the Label model always specified?

Input i get. That is on the page i see what input i typed wrong. And with that date i see immediantly both values
compare to each other.

That password thing is wrong for EqualsInputFormValidator we made a special case yesterday.

But we could improve it somehow.

johan



On 4/20/06, Ingram Chen <[EMAIL PROTECTED]> wrote:
I have some concern about ${input} in Applicaiton_*.properties, for example:

StringValidator.maximum='${input}' must be at most ${maximum} chars.

Why we use ${input} instead of ${label} here? If I limit maximum of chars as 200
and the user input 201 chars. He/she will get a huge long error message!

case 2: for password field, I will get message like:

'mySecretPassword' must be at most 12 chars.
 
which make password visible!

case 3: If I have two Date TextField, one is for startDate, the other is for endDate. Both fields are constraint by DateValidator.maximum. If the user input both fields as '2005/02/05'. He will get message:

'2005/02/05' must be smaller than 2004/01/01.


but he/she has no idea which field is wrong!

Is there any reason why we prefer ${input} over ${label} ?



--
Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen




Reply via email to