Questo contenuto non è disponibile nella lingua selezionata.

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.
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat