Tuesday, January 22, 2013
What's new with the RichFaces extendedDataTable
The upcoming 4.3 release of RichFaces will offer the RichFaces community a number of improvements to the extendedDataTable. These new features include:
- Built-in sorting and filtering
- External table state saving
- A number of bug-fixes
Built-in sorting and filtering
The RichFaces 4 extendedDataTable (EDT) has always had the ability to sort and filter columns, but required the developer to define the sort and filter controls themselves, then manually invoke the required operations on the back-end. While not difficult to do, a lot of boiler-plate code was required for what is in fact a common operation. With RichFaces 4.3 we’ve resolved RF-8125 that tracked a long standing request to port the built-in search capabilities form the RichFaces 3 EDT to RichFaces 4.
Implementing sortable columns in the EDT is now as simple as adding the
sortBy attribute to your EDT column, and the sort controls will automatically be generated and linked to the internal sorting mechanism. To influence how the sorting is performed, add the
comparator attribute to your column, and the comparator defined there will be used for the sort.
Refer to the RichFaces 4 Component Reference for additional details on using the built-in and external sort controls.
sortType=customattribute, and the built-in sort controls will not be rendered. Built-in sort controls can be disabled altogether by setting the web.xml context param
Similarly, taking advantage of the built-in filter controls is also straightforward. Define the
filterValue attribute on the column to be filtered, then define either a
filter attribute to implement the filter logic. When the attributes are present an input element will be displayed in the column header. Simple value conversions are performed implicitly in the EL of the
filterExpression or explicitly in the
Refer to the RichFaces 4 Component Reference for additional details on using the built-in and external filter controls.
filterType=customattribute, and implementing your own filter controls in the back-end. Built-in filter controls can be disabled altogether by setting the web.xml context param
ExtendedDataTable State Saving
The EDT has had another RichFaces 3 feature ported forward: table state saving. With the resolution of RF-10442, application developers can add the
tableState attribute to their EDT components, providing a value-binding to a bean String property that can be used to store the state of the column width, sequence, sorting, and filtering of the EDT. The table state is stored in a JSON string format, and is easily stored in a data base for later retrieval.
In addition to the above feature additions, the EDT has seen a number of bug fixes in the 4.3 release. These fixes include:
- UIDataAdaptor vs. UIData visitTee small difference
- EDT – attribute @clientRows missing in taglib
- Datatable and ExtendedDatatable evaluate value attribute even if rendered=false
- rich:extendedDataTable columnsOrder attribute is not working
- showcase – rich:extendedDataTable – re-sizing columns breaks horizontal scrolling
- Collapsible subtable toggler not rendered
- rich:dataTable doesn’t call restoreState() on a row-level composite component
- rich:extendedDataTable inside rich:tab: The columns which are not frozen are not rendered after switching the tab for the first time in IE 8.
- ExtendedDataTable layout breaks when table element width set to 100%
- Collapsible sub table: noData facet doesn’t work inside switchable panels
- The last page shows rows from the page before if rich:collapsibleSubTable is included in rich:dataTable with rich:dataScroller.
- extendedDataTable: Header facet render problem in RichFaces 4
The 4.3 release
RichFaces 4.3.0.CR1 is currently available, having undergone our extensive QA process, and a 4.3.0.CR2 release will be available shortly. Please take the time to take the extendedDataTable for a spin with this release, and give us your feedback for the new features and bug fixes via the RichFaces forum or issue tracker.