How I did it:

public static void contributeFieldValidatorSource(MappedConfiguration<String, Validator> configuration)
 {
   configuration.add("myvalidator", new MyValidator());
 }


Steven Coco wrote:
I'm REALLY swimming lost here, however I want to use a custom Validator for a form Select widget.

I have the server side down OK. I figured I would try to attach the validator in the template as well -- t:validator="NotEnumElementValidator=UNSELECTED" -- but I don't know how to contribute the validator so I can use it here.

I'm trying obvious things like in my ApplicationModule class:

public static Validator<...> build();

and

public static NotEnumElementValidator buildNotEnumElementValidator();

But no luck trying! I can't find the concrete example in the documentation. Can anyone tell me how I'm supposed to do this?

--About this validator too: it is supposed to take an Enum element that is an invalid selection from a list: I use the old rogue method of having the first item in the Select list say something like "[You must select...]" and then test if the user has chosen some other item. Is this still a modern method of validating a Select element?

This kind of validator seems like it would be a nice fit with the Bean edit form, which seems to support enums too.

Anyway, thanks in advance.

Ciao.
Steev Coco.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Siddhartha Argollo
Técnico Judiciário
TRE-BA
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to