Develop Applications Using Richfaces 4: Developer Guide
Develop Applications Using Richfaces 4: Developer Guide
Develop applications
using RichFaces 4
by Brian Leathem (Red Hat), Lukas Fryc (Red Hat), and Sean Rogers (Red Hat)
1. Introduction ................................................................................................................. 1
2. Getting started with RichFaces ................................................................................... 3
2.1. Technical Requirements ...................................................................................... 3
2.1.1. Project libraries and dependencies ............................................................ 3
2.2. Development environments ................................................................................. 5
2.3. Setting up RichFaces .......................................................................................... 5
2.4. Creating a project with JBoss Tools ..................................................................... 6
2.5. Creating a project with Maven ............................................................................. 6
2.5.1. Setting up Maven ..................................................................................... 6
2.5.2. Using the RichFaces project archetype ...................................................... 7
2.6. Using RichFaces in existing JSF 2 projects ........................................................ 10
3. RichFaces overview ................................................................................................... 11
3.1. Full technical requirements ................................................................................ 11
3.1.1. Server requirements ............................................................................... 11
3.1.2. Client requirements ................................................................................ 11
3.1.3. Development requirements ..................................................................... 11
3.2. Architecture ...................................................................................................... 12
3.2.1. Ajax Action Components ......................................................................... 12
3.2.2. Ajax Containers ...................................................................................... 12
3.2.3. Ajax Output ............................................................................................ 12
3.2.4. Skins and theming ................................................................................. 12
3.2.5. RichFaces Ajax Extensions ..................................................................... 13
3.3. Technologies .................................................................................................... 13
3.4. Differences between JSF and RichFaces mechanisms ........................................ 13
3.5. Restrictions ....................................................................................................... 13
4. Basic concepts .......................................................................................................... 15
4.1. Sending an Ajax request ................................................................................... 15
4.2. Partial tree processing ...................................................................................... 15
4.3. Partial view updates .......................................................................................... 16
4.4. Component overview ......................................................................................... 16
5. Advanced features ..................................................................................................... 17
5.1. JSF 2 integration .............................................................................................. 17
5.2. Error handling ................................................................................................... 17
5.2.1. Client-side errors .................................................................................... 17
5.2.2. Server-side errors .................................................................................. 17
5.3. Other functions ................................................................................................. 17
5.4. Resource loading .............................................................................................. 17
5.4.1. Configuring ResourceServlet ................................................................... 18
5.4.2. Resource optimization ............................................................................ 18
5.4.3. Resource mapping ................................................................................. 19
6. Skinning and theming ................................................................................................ 21
6.1. What are skins? ................................................................................................ 21
6.2. Using skins ....................................................................................................... 21
6.3. Skinning overview ............................................................................................. 22
iii
Developer Guide
iv
A.7.2. <rich:contextMenu> ................................................................................ 75
A.7.3. <rich:panelMenu> .................................................................................. 76
A.7.4. <rich:toolbar> ......................................................................................... 81
A.8. Output and messages ....................................................................................... 82
A.8.1. <rich:message> ..................................................................................... 82
A.8.2. <rich:messages> .................................................................................... 83
A.8.3. <rich:notify> ........................................................................................... 83
A.8.4. <rich:notifyMessage> ............................................................................. 84
A.8.5. <rich:notifyStack> ................................................................................... 85
A.8.6. <rich:progressBar> ................................................................................. 86
A.8.7. <rich:tooltip> .......................................................................................... 86
A.9. Drag and drop .................................................................................................. 87
A.9.1. <rich:dropTarget> ................................................................................... 87
A.9.2. <rich:dragIndicator> ............................................................................... 87
B. Migration Notes ........................................................................................................... 89
B.1. RichFaces 4.3.0.Final ....................................................................................... 89
B.1.1. Built-in sorting and filtering controls ......................................................... 89
B.1.2. NotifyMessage string escaping ............................................................... 89
B.1.3. Select input validation ............................................................................ 89
C. Revision History .......................................................................................................... 91
v
vi
Chapter 1.
Introduction
The RichFaces framework is a rich component library for JavaServer Faces (JSF). The framework
extends the JSF framework's Ajax capabilities with advanced features for enterprise web
application development.
RichFaces leverages several parts of the JSF 2 framework including lifecycle, validation,
conversion facilities, and management of static and dynamic resources. The RichFaces
framework includes components with built-in Ajax support and a customizable look-and-feel that
can be incorporated into JSF applications.
• Create complex application views using out-of-the-box components. The RichFaces user
interface (UI) library (rich) contains components for adding rich interactive features to JSF
applications. It extends the RichFaces framework to include a large set of Ajax-enabled
components that come with extensive skinning support. Additionally, the RichFaces framework
is designed to be used seamlessly with other 3d-party libraries on the same page, so you have
more options for developing applications.
• Write your own customized rich components with built-in Ajax support. The Component
Development Kit (CDK), used for the RichFaces UI library creation, includes a code-generation
facility and a templating facility using XHTML (extended hyper-text markup language) syntax.
• Generate binary resources on the fly. Extensions to JSF 2 resource-handling facilities can
generate images, sounds, Microsoft Excel spreadsheets, and more during run-time.
• Create a modern rich user-interface with skinning technology. RichFaces provides a skinning
feature that allows you to define and manage different color schemes and other parameters of
the look and feel. It is possible to access the skin parameters from page code during run-time.
RichFaces comes packaged with a number of skins to get you started, but you can also easily
create your own customized skins too.
1
2
Chapter 2.
If you have existing projects that use a previous version of RichFaces, refer to the RichFaces
Migration Guide.
• An application server compliant with Java Platform, Enterprise Edition 6 (JEE6), such as JBoss
Application Server 7 or a servlet container coupled with a JSF implementation, such as Apache
Tomcat + Mojarra 2.x.
• A compliant web browser, such as Firefox 17, Chrome 23, or Internet Explorer 9
RichFaces library comes in form of Java archives for Core Framework and Components.
RichFaces libraries
• richfaces-core-api.jar
• richfaces-core-impl.jar
• richfaces-components-api.jar
• richfaces-components-ui.jar
The framework depends on third-party dependencies which can be classified to mandatory and
optional (libraries enabling certain functionality).
Note that these dependencies may depend on their own runtime dependencies.
3
Chapter 2. Getting started wi...
• Google Guava
• CSS Parser
• Bean validation (JSR-303) integration for client-side validation (JSR-303 API and
Implementation)
• javax.inject.jar (version 1)
4
Development environments
Dependencies on Servlet API, JSP API and EL API are excluded since these are
integral parts of both application servers and servlet containers.
• JBoss Tools, as described in Section 2.4, “Creating a project with JBoss Tools”.
Other environments, such as Idea or NetBeans, could also be used for RichFaces development,
but are not detailed in this book.
• archetypes
2. Unzip archive
Create a new directory named RichFaces, then unzip the archive containing the binaries
there.
5
Chapter 2. Getting started wi...
Create a new project based on the JSF 2 environment using the RichFaces 4 template. In
JBoss Tools, select File → New → JSF Project from the menu. Name the project, select JSF
2 from the JSF Environment drop-down box, and click the Finish button to create the project.
Add RichFaces libraries and their mandatory dependencies to the project. Copy them from
the location where you unzipped the RichFaces archive to the WebContent/WEB-INF/lib/
directory of your project in JBoss Tools.
The RichFaces tag libraries need to be referenced on each XHTML page in your project:
<ui:composition xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
...
</ui:composition>
You are now ready to begin constructing your RichFaces applications. RichFaces components
can be dragged and dropped into your application's XHTML pages from the RichFaces palette
in JBoss Tools.
Once Maven has been installed, no further configuration is required to begin building Maven
projects.
6
Using the RichFaces project archetype
The RichFaces Component Development Kit includes a Maven archetype named richfaces-
archetype-simpleapp for generating the basic structure and requirements for a RichFaces
application project. Maven can obtain the archetype from the JBoss repository at https://
repository.jboss.org/nexus/content/groups/public/. The archetype is also included with the
RichFaces source code in the archetypes directory. Follow the procedure in this section to
generate a new Maven-based RichFaces project using the archetype.
The details for the JBoss repository need to be added to Maven so it can access the
archetype. Add a profile in the maven_installation_folder/conf/settings.xml file under
the <profiles> element:
<profiles>
...
<profile>
<id>jboss-public-repository</id>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/
public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/
public/</url>
<layout>default</layout>
<releases>
7
Chapter 2. Getting started wi...
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>jboss-public-repository</activeProfile>
</activeProfiles>
-DgroupId
Defines the package for the Managed Beans
-DartifactId
Defines the name of the project
The command generates a new RichFaces project with the following structure:
new_project
### pom.xml
### readme.txt
### src
### main
8
Using the RichFaces project archetype
### java
# ### org
# ### docs
# ### richfaces
# ### RichBean.java
### webapp
### index.xhtml
### templates
# ### template.xhtml
### WEB-INF
### faces-config.xml
### web.xml
Your root directory of your project contains a project descriptor file, pom.xml. If you wish to
include modules for test-driven JSF development, add any dependencies for the tests to the
pom.xml file.
For testing server-side part of your implementation, check out JBoss Arquillian project [http://
www.jboss.org/arquillian].
If you want to test JSF from client's perspective with ability to access state of JSF internals,
use JBoss JSFUnit project [http://www.jboss.org/jsfunit] (with Arquillian integration).
For automation of client-side tests in real-browser, you may want to employ Arquillian
Ajocado [http://community.jboss.org/wiki/ArquillianAjocado] and Arquillian Drone [https://
docs.jboss.org/author/display/ARQ/Drone] extensions.
For mocking JSF environment, there is set of tools in RichFaces jsf-test project. For full
details on how to use the jsf-test project, refer to article Test Driven JSF Development [http://
community.jboss.org/docs/DOC-13155].
Build the project from the command line by entering the mvn install command.
The BUILD SUCCESSFUL message indicates the project has been assembled and is ready to
import into an IDE (integrated development environment), such as JBoss Tools.
To import the project into Eclipse and JBoss Tools, use the JBoss Maven Integration plug-
ins. These plug-ins work with plug-ins from the M2Eclipse project to import Maven projects.
ii. Select the JBoss Tools update site to use, then open the Maven Support group and
select the JBoss Maven Integration and JBoss Maven JSF Configurator plug-
ins.
iii. Follow the prompts to install the integration plug-ins. The installation will
automatically include the transitive dependencies Maven Integration for Eclipse
and Maven Integration for WTP. Both of these dependencies are from the
M2Eclipse project.
With the plug-ins installed, open the importing wizard by choosing File → Import from
the menu.
Select Maven → Existing Maven Projects as the import source and choose the
directory with the pom.xml file for your project.
The ability to prepare the project for Eclipse and export it using Maven is
deprecated in RichFaces 4.3.2.Final. The process does not support JBoss
integration-specific features, such as JSF Facets.
Your project is now ready to use. Once components and functionality have been added, you can
run the application on a server and access it through a web browser at the address http://
localhost:8080/jsf-app/.
Application-level settings
10
Chapter 3.
RichFaces overview
Read this chapter for technical details on the RichFaces framework.
• An application server compliant with Java Platform, Enterprise Edition 6 (JEE6 or JEE6), such
as JBoss Application Server 7.
• MyFaces 2.x
• Seam 3.x
• Mojara 2.x
Development environment
RichFaces can be developed using most Java development environments. The following are
recommended, and used for examples in this guide:
11
Chapter 3. RichFaces overview
3.2. Architecture
The important elements of the RichFaces framework are as follows:
• Ajax Containers
• Ajax Output
For full details on skinning and how to create skins for the components in your application, refer
to Chapter 6, Skinning and theming.
12
RichFaces Ajax Extensions
3.3. Technologies
RichFaces 4 features full JSF 2 integration and uses standard web application technologies such
as JavaScript, XML (Extensible Markup Language), and XHTML (Extensible Hypertext Markup
Language).
RichFaces evaluates the options when the current request is sent. This increases both the security
of the data and the convenience for evaluating parameters.
For example, binding Ajax options to Java Bean properties in RichFaces allows you to evaluate
the options dynamically for the current request, such as defining additional zones to render.
Parameters changed manually on the client side will not influence the request processing. With
JSF 2, the options have evaluated during the previous page rendering would need to be used.
3.5. Restrictions
The following restrictions apply to applications implementing the RichFaces framework:
• As with most Ajax frameworks, you should not attempt to append or delete elements on a page
using RichFaces Ajax, but should instead replace them. As such, elements that are rendered
conditionally should not be targeted in the render attributes for Ajax controls. For successful
updates, an element with the same identifier as in the response must exist on the page. If it is
necessary to append code to a page, include a placeholder for it (an empty element).
• JSF 2 does not allow resources such as JavaScript or Cascading Style Sheets (CSS) to be
added if the element requiring the resource is not initially present in the JSF tree. As such,
components added to the tree via Ajax must have any required resources already loaded. In
RichFaces, any components added to the JSF tree should have components with corresponding
resources included on the main page initially. To facilitate this, components can use the
rendered="false" setting to not be rendered on the page.
• JSF does render resource links (stylesheets, scripts) in order of occurence, thus if
you add <h:outputStylesheet> to the <h:head> section, JSF will render it before the
RichFaces resource links (dependencies of RichFaces components). To be able to overwrite
13
Chapter 3. RichFaces overview
RichFaces stylesheets and re-use RichFaces JavaScript implementation, you need to render
<h:outputStylesheet target="head"> to the <h:body> section (safe solution is to place it
on the end of the section; however to keep readability, you can use start of the section).
• Switching RichFaces skins via Ajax during runtime should be avoided, as this requires all the
stylesheets to be reloaded.
14
Chapter 4.
Basic concepts
Read this chapter for the basic concepts of using RichFaces in conjunction with Ajax and
JavaServer Faces.
• The <a4j:commandButton> and <a4j:commandLink> tags are used to send an Ajax request
on the click JavaScript event.
• The <a4j:poll> tag is used to send an Ajax request periodically using a timer.
• The <a4j:ajax> tag allows you to add Ajax functionality to standard JSF components and send
Ajax request on a chosen JavaScript event, such as keyup or mouseover, for example.
• Most components in the rich tag library have built-in Ajax support. Refer to the RichFaces
Component Reference for details on the use of each component.
@all
Every component is processed.
@none
No components are processed.
@this
The requesting component with the execute attribute is processed.
@form
The form that contains the requesting component is processed.
@region
The region that contains the requesting component is processed. Use the <a4j:region>
component as a wrapper element to specify regions.
Some components make use of additional keywords. These are detailed under the relevant
component entry in the RichFaces Component Reference.
15
Chapter 4. Basic concepts
@all
Every component is updated.
@none
No components are updated.
@this
The requesting component with the execute attribute is updated.
@form
The form that contains the requesting component is updated.
@region
The region that contains the requesting component is updated. Use the <a4j:region>
component as a wrapper element to specify regions.
Some components make use of additional keywords. These are detailed under the relevant
component entry in the RichFaces Component Reference.
Use the <a4j:outputPanel> component with the ajaxRendered="true" setting to always update
a section irrespective of the requesting component's render attribute. The <rich:message> and
<rich:messages> components are based on the <a4j:outputPanel> component, and as such
will also always be updated. To override this behavior, use the limitRender="true" setting on
the requesting component.
For details on the use of the various components, refer to RichFaces Component Reference.
16
Chapter 5.
Advanced features
Read this chapter for details on some of the advanced features and configuration possibilities for
the RichFaces framework.
• The standard display technology used by JSF 1 was JavaServer Pages (JSP). With JSF 2, the
standard display technology has been changed to Facelets, which is a more powerful and more
efficient View Declaration Language (VLD) than JSP.
17
Chapter 5. Advanced features
• resource mapping - re-routes resource requests (maps an one resource to an another resource)
In the Servlet 2.5 and lower environments, it is necessary to register the ResourceServlet
manually in the WEB-INF/web.xml configuration file:
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/org.richfaces.resources/*</url-pattern>
</servlet-mapping>
The loading of compressed resource packages may lead into significant client performance
boost, since many small files are aggregated into one big file - the number of HTTP connections
necessary to download application resources is significantly decreased.
<context-param>
<param-name>org.richfaces.resourceOptimization.enabled</param-name>
<param-value>true</param-value>
</context-param>
18
Resource mapping
• resources are not compressed in the development stage and during unit-testing to enable client-
side debugging
• resources are compressed in the production stage and during a system-testing to minimize
network bandwidth
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
Configuring the resource mapping means adding new records to the class-path file META-INF/
richfaces/static-resource-mappings.properties.
resourceLibrary\:resourceName=anotherResourceLibrary/anotherResourceName
The definition above contains a JSF resource name on the left side of the
expression and a relative path on the right side.
19
Chapter 5. Advanced features
jquery.js=jquery-alternative-version.js
some\:jquery.js=final/jquery.js
another\:jquery.js=final/jquery.js
Mappings with a resource path starting with http:// or https:// are served as absolute resource
locations:
jquery.js=http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
20
Chapter 6.
Each skin has a set of skin-parameters, which are used to define the theme palette and other
elements of the user interface. These parameters work together with regular CSS declarations,
and can be referred to from within CSS using JavaServer Faces Expression Language (EL).
The skinning feature of RichFaces also allows skins to be changed at runtime, so users can
personalize an application's appearance on the fly.
• DEFAULT
• plain, which contains no skin parameters and is intended for embedding RichFaces
components into existing projects with their own styles.
• emeraldTown
• blueSky
• wine
• japanCherry
• ruby
• classic
• deepMarine
To add one of these skins to your application, add the org.richfaces.SKIN context parameter
to the web.xml configuration file:
21
Chapter 6. Skinning and theming
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>skin_name</param-value>
</context-param>
Component stylesheets
Stylesheets are provided for each component. CSS style parameters map to skin parameters
defined in the skin property file. This mapping is accomplished through the use of ECSS files.
Refer to Section 6.3.3, “ECSS files” for details on ECSS files.
headerGradientColor #F2F7FF
headTextColor #000000
headerWeightFont bold
generalBackgroundColor #FFFFFF
generalTextColor #000000
generalSizeFont 11px
controlTextColor #000000
controlBackgroundColor #FFFFFF
22
Skin parameter tables
shadowBackgroundColor #000000
shadowOpacity 1
panelBorderColor #BED6F8
subBorderColor #FFFFFF
calendarWeekBackgroundColor #F5F5F5
calendarHolidaysBackgroundColor #FFEBDA
calendarHolidaysTextColor #FF7800
calendarCurrentBackgroundColor #FF7800
calendarCurrentTextColor #FFEBDA
calendarSpecBackgroundColor #E4F5E2
calendarSpecTextColor #000000
editorBackgroundColor #F1F1F1
editBackgroundColor #FEFFDA
errorColor #FF0000
gradientType plain
tabBackgroundColor #C6DEFF
tabDisabledTextColor #8DB7F3
tableHeaderBackgroundColor #D6E6FB
tableSubHeaderBackgroundColor #ECF4FE
tableBorderWidth 1px
tableHeaderTextColor #0B356C
trimColor #D6E6FB
tipBackgroundColor #FAE6B0
tipBorderColor #E5973E
selectControlColor #E79A00
generalLinkColor #0078D0
hoverLinkColor #0090FF
visitedLinkColor #0090FF
headerSizeFont 11px
tabSizeFont 11px
buttonSizeFont 11px
23
Chapter 6. Skinning and theming
tableBackgroundColor #FFFFFF
tableFooterBackgroundColor #CCCCCC
tableSubfooterBackgroundColor #F1F1F1
tableBorderColor #C0C0C0
warningColor #FFE6E6
warningBackgroundColor #FF0000
The ECSS code for the <rich:panel> component contains styles for the panel and its body:
.rf-p{
background-color:'#{richSkin.generalBackgroundColor}';
color:'#{richSkin.panelBorderColor}';
border-width:1px;
border-style:solid;
padding:1px;
}
.rf-p-b{
font-size:'#{richSkin.generalSizeFont}';
color:'#{richSkin.generalTextColor}';
font-family:'#{richSkin.generalFamilyFont}';
padding:10px;
}
24
Customizing skins
Component stylesheets
Mappings and other style attributes listed in a component's ECSS file can be edited. Edit the
ECSS file to change the styles of all components of that type.
Using any component, such as a panel, without specifying a styleClass will use the default skin
parameters for that component.
25
Chapter 6. Skinning and theming
When rendered for display, the panel consists of two HTML elements: a wrapper <div> element
and a <div> element for the body of the panel. The wrapper element for a panel without a specified
styleClass is rendered as follows:
To customize the panel appearance according to the three-level scheme, adjust the styles
according to the following approach:
2. Redefine the rf-p class in the application CSS. This will also cause all panels in the
application to change to the new settings, though the skin itself has not been altered. Any
properties not mapped to skin parameters should be redefined in this way.
<rich:panel styleClass="customClass">...</rich:panel>
The customClass style is added to the CSS, and is applied to the component when it is
rendered for display:
The name of the skin file should follow the format new_skin_name.skin.properties and is
placed in either the META-INF/skins/ directory or the classpath directory of your project.
26
Changing skins at runtime
Add skin parameter constants and values to the file. All the skin parameters listed in
Table 6.1, “Parameter settings for the blueSky skin” should be included in the skin file,
with settings relevant to your new skin.
You can use the blueSky.skin.properties file as a template for your new skin.
Instead of redefining an entire new skin, your skin can use an existing skin as a base on
which to build new parameters. Specify a base skin by using the baseSkin parameter in
the skin file, as shown in Example 6.4, “Using a base skin”.
This example takes the blueSky skin as a base and only changes the generalSizeFont
parameter.
baseSkin=blueSky
generalSizeFont=12pt
Add a skin definition <context-param> to the web.xml settings file of your application:
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>new_skin_name</param-value>
</context-param>
27
Chapter 6. Skinning and theming
• Alternatively, use EL (Expression Language) to reference the skin bean from the web.xml
settings file.
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>#{skinBean.skin}</param-value>
</context-param>
The application needs an initial skin to display before the user chooses an alternative skin.
Specify the skin in your class with @ManagedProperty.
@ManagedProperty(value="blueSky")
private String skin;
<managed-bean>
<managed-bean-name>skinBean</managed-bean-name>
<managed-bean-class>SkinBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>skin</property-name>
<value>blueSky</value>
</managed-property>
28
Skinning standard controls
</managed-bean>
Standard HTML controls are skinned in this way by default. To override this behavior and
prevent the RichFaces skins from being applied to the standard HTML controls, set the
org.richfaces.enableControlSkinning context parameter in the web.xml configuration file to
false:
<context-param>
<param-name>org.richfaces.enableControlSkinning</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.enableControlSkinningClasses</param-name>
<param-value>true</param-value>
</context-param>
When enabled, a stylesheet with predefined classes offers a special CSS class named rfs-ctn.
Reference the rfs-ctn class from any container element (such as a <div> element) to skin all
the standard HTML controls in the container.
Standard HTML controls can also be specifically defined in the CSS. Refer to the /core/
impl/src/main/resources/META-INF/resources/skinning_both.ecss file in the richfaces-
ui.jar package for examples of specially-defined CSS classes with skin parameters for HTML
controls.
29
30
Appendix A. Style classes and skin
parameters
Each of the RichFaces components are listed below, along with their style classes and skin
parameters. For further details on each component, refer to the relevant section in the RichFaces
Component Reference.
A.1.1. <a4j:log>
31
Appendix A. Style classes and...
32
Rich inputs
33
Appendix A. Style classes and...
A.2.2. <rich:calendar>
34
<rich:calendar>
35
Appendix A. Style classes and...
generalSizeFont font-size
generalFamilyFont font-family
.rf-cal-holiday background-color
calendarHolidaysBackgroundColor
This class defines the calendarHolidaysTextColor color
styles for weekends and
holidays.
36
<rich:calendar>
37
Appendix A. Style classes and...
38
<rich:calendar>
39
Appendix A. Style classes and...
A.2.3. <rich:editor>
panelBorderColor
.cke_skin_richfaces .cke_dialog_body border-color
generalBackgroundColor background
headerBackgroundColor
.cke_skin_richfaces .cke_dialog_title repeat-x
headerWeightFont font-weight
headerTextColor color
headerFamilyFont font-family
headerSizeFont font-size
.cke_skin_richfaces
.cke_path editorMainTextColor color
a,
.cke_skin_richfaces .cke_path .cke_empty
.cke_rcombo panelBorderColor
.cke_skin_richfaces border-color
a, generalSizeFont font-size
.cke_skin_richfaces
.cke_rcombo
generalFamilyFont font-family
a:active,
.cke_rcombo controlTextColor
.cke_skin_richfaces color
a:hover controlBackgroundColor background-color
headerBackgroundColor
.cke_skin_richfaces .cke_rcombo .cke_openbutton background-color
panelBorderColor border-left-color
40
<rich:fileUpload>
A.2.4. <rich:fileUpload>
41
Appendix A. Style classes and...
42
<rich:inplaceInput>
A.2.5. <rich:inplaceInput>
43
Appendix A. Style classes and...
44
<rich:inputNumberSlider>
A.2.6. <rich:inputNumberSlider>
45
Appendix A. Style classes and...
A.2.7. <rich:inputNumberSpinner>
46
Rich selects
A.3.1. <rich:inplaceSelect>
47
Appendix A. Style classes and...
48
<rich:inplaceSelect>
49
Appendix A. Style classes and...
A.3.2. <rich:select>
50
<rich:orderingList>
A.3.3. <rich:orderingList>
51
Appendix A. Style classes and...
A.3.4. <rich:pickList>
52
<rich:pickList>
53
Appendix A. Style classes and...
A.4.2. <rich:accordion>
54
<rich:accordion>
55
Appendix A. Style classes and...
A.4.3. <rich:collapsiblePanel>
56
<rich:popupPanel>
A.4.4. <rich:popupPanel>
57
Appendix A. Style classes and...
A.4.5. <rich:tabPanel>
58
<rich:tabPanel>
59
Appendix A. Style classes and...
A.5.1. <rich:dataTable>
60
<rich:dataTable>
61
Appendix A. Style classes and...
A.5.2. <rich:collapsibleSubTable>
62
<rich:collapsibleSubTable>
63
Appendix A. Style classes and...
A.5.3. <rich:collapsibleSubTableToggler>
.rf-csttg
This class defines styles for a toggle control.
64
<rich:extendedDataTable>
.rf-csttg-exp
This class defines styles for a toggle control which expands the sub-table.
.rf-csttg-colps
This class defines styles for a toggle control which collapses the sub-table.
A.5.4. <rich:extendedDataTable>
65
Appendix A. Style classes and...
66
<rich:dataGrid>
A.5.5. <rich:dataGrid>
67
Appendix A. Style classes and...
68
<rich:list>
A.5.6. <rich:list>
A.5.7. <rich:dataScroller>
69
Appendix A. Style classes and...
70
Trees
A.6. Trees
A.6.1. <rich:tree>
.rf-tr-nd
This class defines styles for the nodes in a tree.
.rf-tr-nd-last
This class defines styles for last node in a tree.
.rf-tr-nd-colps
This class defines styles for a collapsed tree node.
.rf-tr-nd-exp
This class defines styles for an expanded tree node.
A.6.2. <rich:treeNode>
71
Appendix A. Style classes and...
72
Menus and toolbars
A.7.1. <rich:dropDownMenu>
73
Appendix A. Style classes and...
74
<rich:contextMenu>
A.7.2. <rich:contextMenu>
75
Appendix A. Style classes and...
A.7.3. <rich:panelMenu>
76
<rich:panelMenu>
77
Appendix A. Style classes and...
78
<rich:panelMenu>
79
Appendix A. Style classes and...
80
<rich:toolbar>
A.7.4. <rich:toolbar>
81
Appendix A. Style classes and...
A.8.1. <rich:message>
82
<rich:messages>
A.8.2. <rich:messages>
A.8.3. <rich:notify>
83
Appendix A. Style classes and...
A.8.4. <rich:notifyMessage>
84
<rich:notifyStack>
A.8.5. <rich:notifyStack>
85
Appendix A. Style classes and...
A.8.6. <rich:progressBar>
A.8.7. <rich:tooltip>
86
Drag and drop
.rf-drp-hvr
This class defines styles for the drop target when a dragged item is hovering over it.
.rf-drp-hlight
This class defines styles for a highlighted drop target.
A.9.2. <rich:dragIndicator>
.rf-ind
This class defines styles for the drag indicator.
.rf-ind-drag.accept
This class defines styles for the indicator when it is over an acceptable drop target.
.rf-ind-drag.reject
This class defines styles for the indicator when it is over an unacceptable drop target.
.rf-ind-drag.default
This class defines styles for the indicator when it is being dragged, and is not over any drop
targets.
87
88
Appendix B. Migration Notes
This section of the guide will track any breaking changes introduced in new releases, and identify
any steps required to accommodate those changes in your application.
For details on disabling the built-in sort and filter controls, refer to sections "External filter controls"
and "External sort controls" in the RichFaces Component Reference.
89
90
Appendix C. Revision History
Revision History
Revision 1.0 Mon Apr 11 2011 SeanRogers
4.0.0.Final Release
Revision 1.1 Wed Nov 16 2011 BrianLeathem, LukasFryc
4.1.0.Final Release
Revision 1.2 Wed Feb 22 2011 BrianLeathem, LukasFryc
4.2.0.Final Release
91
92