Kevin Menard wrote:
Hi Paul,
On Jun 28, 2005, at 2:05 PM, Paul Ferraro wrote:
The process for recording validation errors using the
IValidationDelegate has not changed.
I like to add markup to indicate a component is required to have a
value in my validation delegate. However, when writeSuffix() is
encountered in the delegate, the validator object is always null. Am
I doing something wrong? FWIW, the delegate will detect that an
error has occurred later on. Also, if multiple validators are
defined, how does it affect the semantics of the parameters of this
method?
Thanks,
Kevin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I believe the reason that validator is null because it uses the old
validation interface "IValidator". If you are using the new validation
system, you will be using validators that implement the "Validator"
interface. Below is a code snippet to get all the validators for a
particular component:
ValidatorsBinding vb = (ValidatorsBinding)
component.getBinding("validators");
Collection collection = (Collection) vb.getObject();
for(Iterator it = collection.iterator();it.hasNext();){
Validator validatorObject = (Validator) it.next();
System.out.println("Validator" +
validatorObject.getClass().getName());
}
So in your case if you would check tat the class name of a validator is
"org.apache.tapestry.form.validator.Required", then you can put the
required field marker.
scott.
--
Scott F. Walter Scott F. Walter
Principal Consultant
Vivare, Inc.
E: [EMAIL PROTECTED]
E: [EMAIL PROTECTED]
Visit scottwalter.com <http://scottwalter.com> --Point. Click. Explore!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]