Hi Gerhard, Disabling the standard requirements for just an add on of ExtVal seems a bit too drastic, but a transformer seems a good idea. I'll try to make something and post it.
Regards Rudy. On 18 July 2011 21:58, Gerhard Petracek <[email protected]> wrote: > hi rudy, > > we could discuss a bval feature which relaxes such rules (it would be > deactivated by default). > or something like transformer for constraints. > > regards, > gerhard > > http://www.irian.at > > Your JSF powerhouse - > JSF Consulting, Development and > Courses in English and German > > Professional Support for Apache MyFaces > > > > 2011/7/18 Rudy De Busscher <[email protected]> > >> hi All, >> >> The situation is a bit difficult to describe both I have a use case where >> I would like to create a custom validation annotation where I need to define >> a non empty groups attribute >> >> something like this >> *@Target(value = { ElementType.FIELD}) >> @Retention(value = RetentionPolicy.RUNTIME) >> @Constraint(validatedBy = { EqualsValidator.class }) >> public @interface Equals >> { >> String message() default "{duplicated_content_required}"; >> >> Class<?>[] groups() default {CrossValidationGroup.class}; >> >> Class<? extends Payload>[] payload() default {}; >> >> String[] value(); >> } >> * >> >> But as expected, I get a error when I try to use the annotation: >> Default value for groups() must be an empty array >> >> But I want to avoid that the user needs to define it always when he uses >> the annotation. >> * @Equals(value = "caseSensitiveTarget", groups = >> CrossValidationGroup.class) >> private String caseSensitiveSource;* >> >> >> Any idea or direction I need to look into are apreciated. >> >> Regards >> >> -- >> Rudy De Busscher >> http://www.c4j.be >> >> > -- Rudy De Busscher http://www.c4j.be
