Sorry, I mean @Translate("lowercase") On Fri, Jan 30, 2009 at 2:30 PM, Onno Scheffers <o...@piraya.nl> wrote: >> >> How about defining a "lowercase" translator, and using >> @Validate("lowercase") on those fields? > > > > Hi Howard, > > thanks for your response. > > I didn't know it was possible to use translator-names as arguments to the > Validate annotation. > Do I still have to contribute the translator in some way or is it enough to > just add it to the translators sub-package? > > I did try it without contributing and although I don't get any errors on the > page, the user-input is not converted to lower-case and if I do contribute > it, _all_ string-fields are converted to lower-case. > > regards, > > Onno > > > > >> > Is there a way I can setup a custom String validator that is only added >> to >> > fields I explicitly set the translator for? >> > >> > I want to make sure some TextFields (username and email-address) are >> > converted to lowercase Strings. I figured a Translator would be useful >> for >> > that. But when I create a LowercaseTranslator using the name 'lowercase' >> all >> > TextFields in the application seem to use the LowercaseTranslator all of >> a >> > sudden. >> > >> > This is how I contributed my Translator: >> > >> > public static void contributeTranslatorSource(Configuration<Translator> >> > configuration) { >> > configuration.add(new LowercaseTranslator()); >> > } >> > >> > regards, >> > >> > Onno >> > >> >> >> >> -- >> Howard M. Lewis Ship >> >> Creator Apache Tapestry and Apache HiveMind >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >
-- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org