Hi

I'm a bit confused about validators in Tapestry 4.0.2. The doc says the 
following ought to work:

import org.apache.tapestry.annotations.*;
import org.apache.tapestry.form.validator.Max;
import org.apache.tapestry.form.validator.Validator;

@ComponentClass(allowInformalParameters = false, allowBody = true)
public abstract class EditEventForm extends BaseComponent
{
    @Bean(Max.class)
    public abstract Validator getMyMaxValidator();

    public abstract int getMyfieldval();

    @Component(type="TextField", bindings =
    { "displayName=message:my-label", "value=myfieldval",
      
"validators=validators:$myMaxValidator,max=2000[%my-resource-bundle-error-message-key]",
      "translator=translator:number"})
    public abstract IFormComponent getMyField();
 ...
}

The fields display fine and work fine, however, validation doesn't work right 
because the max value and message don't get filled in. Why?

Also, what's the difference between:

org.apache.tapestry.valid.*Validator
org.apache.tapestry.form.validator.*

It seems only org.apache.tapestry.form.validator.*  will work. For example, if 
I try to use IntValidator, I get an exception that it can't be instantiated.

Any help is appreciated.
Thanks,
Julian

Reply via email to