myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Ok <>
Subject [GSOC] Implicit validation/conversion
Date Mon, 07 Jun 2010 21:28:08 GMT

For <hx:color> component, I want to make sure sent value is a valid simple
color[0]. e.g: #F0A1B2
This is a good use case for a converter, but necessity for automatic
attaching makes things complicated.

I tried the approaches below, all of them have some problems, and I don't
want to follow them.

* Overriding setValue(..) method in HtmlInputColor which is the component
class :=) (breaks JSF lifecycle. Some manual validation is done, even though
validator processing phase is over)
* Attaching "ColorValidator implements Validator" at facelet handler
* At facelet handler, attaching "ColorConverter implements Converter" which
converts input to "Color" model pojo  (a component can have one converter,
so we should prevent other converters being attached, which is unacceptable)

Do we have a better alternative? Any example?



My Blog:

View raw message