I'd like for something like <t:textfield value="bean.textvalue" /> to somehow know what validators (length,etc) to use.
There seems to be a way to do this with annotations on the bean's fields, but I am using Cayenne which stores constraint information in an xml file, and do not want to duplicate this by adding annotations. So my ValidationConstraintGenerator would need to know what bean class and which property to look up things from the xml file. In the t5-cayenne project the ValidationConstraintGenerator pulls the BeanEditContext and PropertyEditContext from the Environment, and gets the necessary information from those. These are only available inside a BeanEditor though. Is there some other method for generating validators automatically? The internal AccessableObjectAnnotationProvider looks interesting, as it can access the property and bean class, and so would be able to mock up an @Validate annotation. It doesn't look like it's meant to be overridden though. -- View this message in context: http://tapestry-users.832.n2.nabble.com/Is-there-a-way-to-automatically-generate-validation-constraints-on-standalone-fields-tp5579233p5579233.html Sent from the Tapestry Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
