Create new RichFaces Documentation Jira issue

This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

6.6.10.  < rich:dataTable > available since 3.0.0

The component is meant for rendering tables. It allows choosing data from a model and obtains built-in support of Ajax updates.


The <rich:dataTable> component is similar to the <h:dataTable> one, except Ajax support and skinnability. Ajax support is possible, because the component was created basing on the <a4j:repeat> component and as a result it could be partially updated with Ajax. The "ajaxKeys" attribute allows to define row keys which are updated after an Ajax request. You can find an example which demonstrate the usage of the "ajaxKeys" attributes for data iteration components in the RichFaces Cookbook article.

The component allows to use "header" , "footer" and "caption" facets for output. See an example below:

Example:


...
<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
        <f:facet name="caption">
                <h:outputText value="United States Capitals" />
        </f:facet>
        <f:facet name="header">
                <h:outputText value="Capitals and States Table" />
        </f:facet>
        <rich:column>
                <f:facet name="header">State Flag</f:facet>
                        <h:graphicImage value="#{cap.stateFlag}"/>
                <f:facet name="footer">State Flag</f:facet>
        </rich:column>
        <rich:column>
                <f:facet name="header">State Name</f:facet>
                        <h:outputText value="#{cap.state}"/>
                <f:facet name="footer">State Name</f:facet>
        </rich:column>
        <rich:column >
                <f:facet name="header">State Capital</f:facet>
                        <h:outputText value="#{cap.name}"/>
                <f:facet name="footer">State Capital</f:facet>
        </rich:column>
        <rich:column>
                <f:facet name="header">Time Zone</f:facet>
                    <h:outputText value="#{cap.timeZone}"/>
                <f:facet name="footer">Time Zone</f:facet>
        </rich:column>
        <f:facet name="footer">
                <h:outputText value="Capitals and States Table" />
        </f:facet>
</rich:dataTable>
...

This is a result:


Information about sorting and filtering you can find in the corresponding section.

You can find information how to remove header's gradient in the "How to remove rich:dataTable header background " article.

Table of <rich:dataTable> attributes.






You can find all necessary information about style classes redefinition in
Definition of Custom Style Classes section.

On the component LiveDemo page you can see the example of <rich:dataTable> usage and sources for the given example.

The article about <rich:dataTable> flexibility can be found in the "rich:dataTable Flexibility " article .

Article on dataTable skinability provides you a simple example of skinnability.

More information about using <rich:dataTable> and <rich:subTable> could be found on the RichFaces Users Forum.

How to use <rich:dataTable> and <rich:datascroller> in a context of Extended Data Model see on the RichFaces Users Forum.

From "rich:dataTable border to 0px " article you'll figure out how to set rich:dataTable border to 0px

dataTable Background Out tells you how to remove rich:dataTable header background