The prefix for the new validation is "validators:" not "validator:". "validator" was for the old system. I ran into this problem about a dozen times when revving our system to T4.
On 10/18/05, Jesse Kuhnert <[EMAIL PROTECTED]> wrote: > > Ahhh..I think I have an even better idea on what it is, now that I know > IValidator is deprecated... > > The tapestry.form.xml spec has ValidatableFieldSupport configured as > follows: > <service-point id="ValidatableFieldSupport" interface=" > org.apache.tapestry.form.ValidatableFieldSupport"> > <invoke-factory> > <construct class="ValidatableFieldSupportImpl"> > <set-object property="valueConverter" > value="infrastructure:valueConverter"/> > <set-service property="threadLocale" service-id="hivemind.ThreadLocale"/> > </construct> > </invoke-factory> > </service-point> > > The problem is that valueConverter will translate validator: prefixes into > IValidator instances...In order to get a proper list of the new Validator > classes you need to use ValidatorFactory instead. (Or so it would seem). > > so...If the getValidatorsIterator method of FieldSupportImpl used this > instead it would all work...Or if the binding prefix of validator: was > changed over to the ValidatorFactory instead. ... > > Or I'm totally wrong ;), which is probably the case... > > jesse > > On 10/18/05, Jesse Kuhnert <[EMAIL PROTECTED]> wrote: > > > > Then what type of validator would be returned from using a string > binding > > such as what is found here > http://jakarta.apache.org/tapestry/UsersGuide/validation.html > > ? > > > > The documentation seems to all hint at using IValidator. Does this mean > > that we need to go back to the bean definition style of validation over > the > > much more pleasant string parameter? > > > > I've probably completely overlooked whatever is obvious to you, but the > > documentation + source leaves me scratching my head. > > > > jesse > > > > On 10/18/05, Kent Tong <[EMAIL PROTECTED]> wrote: > > > > > > Jesse Kuhnert <jkuhnert <at> gmail.com <http://gmail.com> < > http://gmail.com>> writes: > > > > > > > The reason why is that ValidatableFieldSupportImpl is casting the > > > objects > > > > recieved from the ValueConverter into Validator objects...Which work > > > > wonderfully if you are using the old, and from the current > > > documentation > > > > "deprecated" ValidField component...If however you are trying to use > > > one of > > > > the new snazzy abilities of TextField/DatePicker/etc.. you will get > > > > ClassCastExceptions when the ValidatableFieldSupportImpl class > > > incorrectly > > > > casts objects that are instances of IValidator over to Validator. > > > > > > I don't understand what you're saying. The new snazzy abilities use > > > the org.apache.tapestry.form.validator.Validator interface while > > > the old system uses the > > > org.apache.tapestry.valid.IValidator interface. So > > > ValidatableFieldSupportImpl > > > is obviously using the new validation system but not the old one. > > > > > > -- > > > Author of a book for learning Tapestry ( > > > www.agileskills2.org/EWDT<http://www.agileskills2.org/EWDT> > <http://www.agileskills2.org/EWDT> > > > ) > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > >
