Bart Molenkamp wrote:
Hi all,
Why are repeaters not ValidationErrorAware? I have the requirement that
my repeater contains at least 1 row. I can check that with a JavaScript
validator, but where can I set the error? Should Repeater implement
ValidationErrorAware for this kind of use cases?
A repeater cannot hold a validation error, because errors on a repeater are most likely to be caused by its content (or lack thereof).
I had the same requirement as yours, and implemented it in a different way: if the user removes the last remaining row in a repeater, an empty row is recreated immediately (it's in the delete action's event listener). Since the row contains required fields, the form cannot sucessfully validate unless at least one row is correctly filled.
Hope this helps, Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
