Este contenido no está disponible en el idioma seleccionado.

4.4.6. Built-in Skinnability in RichFaces


RichFaces lets you incorporate skins into your user interface (UI) design. This framework lets you use named skin parameters in your properties files to control skin appearance consistently across a set of components. You can see examples of predefined skins at: http://livedemo.exadel.com/richfaces-demo/
Skins let you define a style in which to render standard JSF components and custom JSF components built with RichFaces. You can experiment with skins by following these steps:
  • Create a custom render kit and register it in the faces-config.xml like so:
    <render-kit>
         <render-kit-id>NEW_SKIN</render-kit-id>
         <render-kit-class>org.ajax4jsf.framework.renderer.ChameleonRenderKitImpl</render-kit-class>
    </render-kit>
    Copy to Clipboard Toggle word wrap
  • Next, create and register custom renderers for the component based on the look-and-feel predefined variables:
    <renderer>
    	<component-family>javax.faces.Command</component-family>
        <renderer-type>javax.faces.Link</renderer-type>
        <renderer-class>newskin.HtmlCommandLinkRenderer</renderer-class>
    </renderer>
    Copy to Clipboard Toggle word wrap
  • Finally, place a properties file with skin parameters into the class path root. There are two requirements for the properties file:
    • The file must be named skinName.skin.properties. In this case, we would call it newskin.skin.properties.
    • The first line in this file should be render.kit=render-kit-id. In this case, we would use render.kit=NEW_SKIN.
More information about creating custom renderers can be found at: http://java.sun.com/javaee/javaserverfaces/reference/docs/index.html.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat