Stable Release
4.0
Released 02 Oct 2013
(12 years ago)
SoftwarePrimeFaces
Version4.0
Initial release4.0
02 Oct 2013
(12 years ago)
Latest release4.0
02 Oct 2013
(12 years ago)
Release noteshttps://github.com/primefaces/primefaces/releases/tag/4.0
Source codehttps://github.com/primefaces/primefaces/tree/4.0-RELEASE
Documentationhttps://javadoc.io/doc/org.primefaces/primefaces/4.0/index.html
Downloadhttps://mvnrepository.com/artifact/org.primefaces/primefaces/4.0
PrimeFaces 4.0 ReleasesView full list

What Is New in PrimeFaces 4.0

PrimeFaces 4.0 is a major release packed with new components, enhancements, and bug fixes. This version solidifies the framework's feature set and improves the overall developer experience.

Category Key Highlights
New Components Lightbox, Ring, Dock, Terminal, ImageCompare, Captcha
New Features AJAX Status, BlockUI, Focus, RequestContext API, MenuModel API
Enhancements DataTable filtering, Row Editing, LazyDataModel, Dialog Framework
Mobile PrimeFaces Mobile module introduction

What new components were introduced?

Version 4.0 adds several powerful components to the arsenal. The Lightbox component displays images and videos in a modal overlay, perfect for galleries. Ring provides an Apple-style dock menu for navigation, while Terminal offers a command-line interface right in the browser.

For security and UX, Captcha was introduced to prevent automated form submissions. ImageCompare allows users to interactively compare two images with a slider, which is useful for showcasing before-and-after scenarios.

How was the existing component suite improved?

Major enhancements were focused on the workhorse DataTable. It gained powerful built-in filtering capabilities, making it easier to sift through data without extra code. The new row editing feature provides a streamlined way to edit records inline, a significant step up from the existing cell editing.

The LazyDataModel was overhauled to support pagination, sorting, and filtering callbacks, which is critical for efficiently handling massive datasets. The Dialog Framework was also improved, allowing developers to navigate to a page and treat it as a modal dialog, simplifying complex UI flows.

What are the key utility features for developers?

This release introduced several utilities that simplify common tasks. The AJAX Status component provides visual feedback for ongoing AJAX requests. BlockUI blocks user interaction with a specific area or the whole page during processing.

The new RequestContext API offers programmatic control over the AJAX request lifecycle, allowing you to dynamically add callbacks, update components, or execute scripts. The MenuModel API provides a programmatic way to create dynamic menus, which is much cleaner than building them in XHTML.

Is there mobile support in this version?

Yes, PrimeFaces 4.0 marks the introduction of the PrimeFaces Mobile module. This is a separate JAR that provides a suite of components specifically designed for mobile touch interfaces, following the jQuery Mobile framework.

In practice, this means you can build applications that target mobile devices with a native look and feel, separate from your main desktop application. It's a dedicated solution rather than a responsive adaptation of the existing components.

FAQ

Does the new row editing in DataTable replace cell editing?
No, row editing is an additional feature. It provides a different user experience where a user edits all cells in a row at once and then saves or cancels the changes, whereas cell editing is for editing individual cells.

What is the main advantage of using the MenuModel API?
The main advantage is dynamic menu creation. Instead of building a static menu in your XHTML page, you can now build the menu model programmatically in your backing bean, which is essential for menus that change based on user permissions or application state.

How does the new LazyDataModel improve performance?
It pushes pagination, sorting, and filtering logic to the database level. The model only loads the specific slice of data needed for the current view, which is crucial for handling large datasets without consuming excessive memory.

Is the PrimeFaces Mobile module included in the main JAR?
No, it is a separate JAR file (primefaces-mobile.jar). You must add this additional library to your project's classpath to use the mobile-specific components.

Can I use the RequestContext API outside of AJAX listeners?
Yes, the RequestContext API is versatile. You can use it within your regular Java methods to dynamically add components to update, execute JavaScript, or open dialogs based on your business logic, not just in response to an AJAX event.

Releases In Branch 4.0

VersionRelease date
4.002 Oct 2013
(12 years ago)