A simple example is the dynamic rendering of range input fields. A validator should be added only to the second field (e.g. dateTo or a max size) which validates the lower value and the upper value. Or some input fields could be of type email and should be validated accordingly but be rendered like other fields.
I'll add an "active" attribute to my custom validators as Simon mentioned. I am again a little bit astonished that this is missing in all standard validators because this seems to me like a standard use case. So there following alternatives: - use component bindings and add the validators dynamically - use separate input fields with rendered checks (one with validator and one without which is ugly) - add "active" attribute to standard validators Michael -----Original Message----- From: simon [mailto:[EMAIL PROTECTED] Sent: Freitag, 19. Oktober 2007 19:43 To: MyFaces Discussion Subject: Re: optional validator - missing rendered attribute Hi Michael, This requirement does sound a bit odd to me. To me, the primary role for a validator is to determine whether the data is safe to push into the model. Why would you want to bypass that kind of check in any circumstance? Regards, Simon On Fri, 2007-10-19 at 10:51 -0400, Simon Lessard wrote: > Hello Michael, > > You could add the check directly inside the validate method to see if > the validation should occur or not. Also since validators aren't > visual artifacts, rendered would not be very semantically correct. > However, I guess a "relevant" or "active" attribute could have been > considered, but that would imply some specification changes to work > with every validators and component libraries. > > > Regards, > > ~ Simon > > > Regards, > > ~ Simon > > On 10/19/07, Michael Heinen <[EMAIL PROTECTED]> wrote: > Is there any reason why validators don't have a rendered > attribute? > > I use a dataList to render a List of fields dynamically and > want to add a validator to an input field depending on an EL > expression. > > > > I found some old discussions in the list about optional > validators but did not find detailed info. > > > > How can I accomplish this without without doubling the outer > input fields? > > > > > > Michael > > >

