Thanks for all your suggestions.
In the mean time I have solved my issue with a custom validation phase listener. After the validation it appends an error style class to the styleClass attribute of the components with messages.

With kind regards
Florian

"Matt Cooper" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED]
I think using a custom skin would be more robust.  I wonder if
defining a skin extension with the following definition would be
sufficient:

af|inputText:error::content {
 background-color: red;
}

This definition means that the the background-color applies to the
internal psuedo-element named "content" of the the inputText component
when the inputText is in an "error" state.

(I have not tested this myself.)

Regards,
Matt

On Wed, Aug 6, 2008 at 8:46 AM, Matthias Wessendorf <[EMAIL PROTECTED]> wrote:
Hi,

in the past I wrote a blog entry about how to extend the Trinidad renderers.
Perhaps that helps you as well (see [1]).

-Matthias

[1] http://matthiaswessendorf.wordpress.com/2008/02/20/extending-trinidads-default-renderers/

On Wed, Aug 6, 2008 at 4:38 PM,  <[EMAIL PROTECTED]> wrote:
Hi,

I recently started using a custom OutputLabelRenderer which is a subclass of
the Trinidad's default renderer.
I don't know if you can decorate an existing renderer.

To replace the default OutputLabelRenderer I put the following fragment in
faces-config.xml

  <render-kit>

<render-kit-id>org.apache.myfaces.trinidadinternal.core</render-kit-id>
    <!-- render-kit-class></render-kit-class -->
    <renderer>

<component-family>org.apache.myfaces.trinidad.Output</component-family>
      <renderer-type>org.apache.myfaces.trinidad.Label</renderer-type>

<renderer-class>com.mycompany.jsf.renderkit.core.xhtml.OutputLabelRenderer</renderer-class>
    </renderer>
  </render-kit>

I did have some trouble finding out which renderkit id to use. If you don;t
use the correct id the default may still be used instead of your own.

Hope this helps.
Good luck,

Freek Segers

________________________________
From: Florian Reiser [mailto:[EMAIL PROTECTED]
Sent: 06 augustus 2008 11:04
To: MyFaces Discussion
Subject: Extending the default renders of input components

Hello,



I want to render input components with a red background if validation
failed.

To enable this behaviour for all components I thought of writing a decorator
for the renderers,

which appends a specific css-class to the fields if the validation failed.



How do I tell jsf to decorate the renderers?



With kind regards

Florian Reiser

================================================
The information transmitted via this e-mail is intended only for the person
or entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any
computer.




--
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org




Reply via email to