Hi, I did that the following way:
on submit of the form i call a javascript function submitValues() which
stores all values of the forms input components into a hidden input
value (for example as a comma separated list), which is located in
annother form. after submitting that form all data is retrieved via a
valuechanglistener on that hidden input field.
--> In your case, you could implement a check to the database here, in
case of any duplicate value you could return a message..
Of course there are some disadvantages:
- you need to write the Javascript functions, probably some extra data
conversion
- any other validation, for example datatype, is ignored as the
"original" form is never submit - you have to implement this in the
changelistener yourself!
Hope this helps, I'm very interested in your solution / other (better
:-) solutions!
Greets,
Hans
Marco wrote:
Hi All;
I have dataTable that generates a list of inputText fields, and i want
to check each inputText if its value existed before in the DB (I made
my custom validator and it's working fine and prints an error message
below each existed inputText value), but that will be an issue of
performance if i had lots of inputText fields.
So i want to validate a list containing the values of the inputText
fields instead, so how can i collect these values in a list and pass
it my validator (and prints an error message below each existed
inputText value) ?
Thanks a lot