tr:validateLongRange inconsistent behavior
------------------------------------------
Key: TRINIDAD-726
URL: https://issues.apache.org/jira/browse/TRINIDAD-726
Project: MyFaces Trinidad
Issue Type: Bug
Components: Components
Reporter: Eric Fikus
Suppose I have an inputText whose value must be a positive integer:
<tr:inputText>
<tr:validateLongRange minimum="1" messageDetailMinimum="The quantity
must be a positive integer"/>
</tr:inputText>
There are several problems with the validator's behavior.
1. If I enter a string (with no numbers) I see the supplied
messageDetailMinimum. If I enter a number with a decimal point I see another
message, "Validation Error: Value is not of the correct type.". Apparently
there is no way to change this text. I would prefer to either see the
messageDetailMinimum (as happens with a string) or to add an attribute to the
tag to specify the message to show when the value is not an integer. The
default "Value is not of the correct type" is not really acceptable to me from
a usability perspective.
2. Suppose I have another inputText on the same page that is required. If I
leave that field blank and enter a floating point number in my numeric input, I
will only see a validation error for the required field. I won't see that the
numeric value is not of the correct type until I supply data for all required
fields.
3. If I enter a floating point number and submit the form, I see the "Value is
not of the correct type" message. If I change the value so it has another
validation error, for example by entering a number that is out of range, the
new error message is added to the page but the original one is not removed. So
the field will show two error messages, in this case "Validation Error: Value
is not of the correct type." followed by "The quantity must be a positive
integer". Despite the fact that the value is now the correct type.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.