myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rudy De Busscher <>
Subject Re: ExtVal: Rendering component with visual indication for required fields
Date Mon, 26 Apr 2010 13:41:36 GMT

The main issue with your requirement is that at the time of the rendering of
the outputlabel, the input text isn't treated yet (because the label is most
of the time in front of the input field).  So the required property of the
input field isn't set yet by the extval framework. (only the information of
the view is applied, not the annotations on the properties of the classes)

You mention also the renderer interceptor.  But standard this renderer is
only hit for any editableValueHolder( like input fields or drop downs).
Since those are the type of components we are interested in ( in doing the
The labels aren't treated at this moment (see processComponent method in
AbstractValidationInterceptor) so you should write a custom renderer
interceptor to achieve it.

Your requirements is already on my development list (as an add-on) for a few
months now but had not the time to start with it.

So you need to create (at least) the following items:
- A custom renderer interceptor for handling the output labels
- A component initializer that put the * in front of it (caution that it
isn't done multiple times)
- The component initializer should search for the referenced component (by
the for attribute) and do the component initialization of this
EditableValueHolder.  Now the @NotNull is taken into account and the * can
be placed.

You can also look at the Trinidad support module
It has a label that is capable of putting a * behind the text so it is
possible that there is already the kind of solution to your problem.  You
need to port it then only to the standard JSF (or use Trinidad in your


On 26 April 2010 14:57, <> wrote:

> Hi there,
> I've found some information at
>, that it is
> possible to mark components who require a value via a component initializer.
> In addition I would like to use bean validation and to annotate a class'
> attributes and mark the input field or even the label of the input field:
> 1. @NotNull for an attribute let's say "name"
> 2. Having an output label referencing an input field
> 3. Marking all labels referencing to required fields with a '*' resulting
> in "*name"
> I also found the renderer interceptor which seems to be a better choice for
> me, since I want to manipulate the rendering of the label rather than the
> input component.
> Any suggestions?
> Thanks.
> Traumziele - von Beschreibung bis Buchung jetzt kompakt auf den
> Reise-Seiten von!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message