What Is New in PrimeFaces 6.0
PrimeFaces 6.0 is a major release packed with new components, enhancements, and bug fixes. It represents a significant step forward for the JSF ecosystem. Here's a high-level summary of the key changes.
| Category | Key Items |
|---|---|
| New Components | SpeedDial, Card, Knob, Timeline, Organization Chart |
| Major Improvements | Client-side Validation, Material Design Theme, Input Mask |
| Bug Fixes | Over 200 issues resolved across the suite |
| Dependencies | JSF 2.2+ and Java 7+ required |
What new components were introduced?
This release introduces several powerful new components to the PrimeFaces arsenal. They provide fresh UI patterns and data visualization options for modern applications.
SpeedDial
A floating action button that displays a popup menu with multiple actions. It's perfect for creating compact, mobile-friendly UIs with a Material Design feel.
Card
A flexible container component for displaying content in a card layout. It standardizes a common UI pattern that was previously built manually.
Knob
A dial-style input component for selecting numeric values. It offers a more visually engaging alternative to a standard slider for certain use cases.
Timeline
Visualizes events in a horizontal or vertical timeline. This is great for displaying histories, schedules, or any time-based data series.
Organization Chart
Renders hierarchical organizational data in a tree-like structure. It's ideal for company directories or reporting structure visualizations.
How was client-side validation improved?
Client-side validation received a major overhaul, making it more robust and easier to use. The Bean Validation integration is now much more seamless.
You can now use p:clientValidator to attach validators directly to components. This simplifies the process of adding custom validation logic that executes on the client without a server round-trip.
<p:inputText id="customField" value="#{bean.value}">
<p:clientValidator />
</p:inputText>
The feedback is also more immediate, improving the overall user experience by catching errors as they type.
What themes and styling updates are included?
The theming support got a significant boost with the introduction of a premium Material Design theme. This gives applications a modern, Google-inspired look and feel out of the box.
The input mask component was rewritten for better performance and reliability. It now handles complex patterns more gracefully and has fewer edge cases.
Overall, the default styling across all components was refined for a more consistent and polished appearance. This matters because it reduces the custom CSS you need to write to achieve a professional look.
What are the key dependency requirements?
PrimeFaces 6.0 raises the baseline for required technologies. You'll need to ensure your project is running on a compatible stack before upgrading.
The minimum Java version is now 7. This allows the implementation to use newer language features and APIs. For JSF, version 2.2 or higher is mandatory.
In practice, this means older servers running Java 6 or JSF 2.1 cannot use this version. It's a necessary step to keep the library modern and maintainable.
FAQ
Is PrimeFaces 6.0 backwards compatible with previous versions?
For the most part, yes. However, due to the major version jump, always check the release notes for specific deprecated features and test your application thoroughly. The requirement for JSF 2.2+ is the biggest compatibility consideration.
How do I use the new SpeedDial component?
Wrap it around command components like p:commandButton. The buttons you place inside become the items in the popup menu when the main button is clicked.
Does the new client-side validation replace JSF validation?
No, it complements it. It runs before JSF validation, providing immediate user feedback. The server-side validation still executes as a final security and consistency check.
What was the main reason for dropping Java 6 support?
To modernize the codebase. Java 6 was end-of-life, and moving to Java 7 allowed the developers to use try-with-resources, the diamond operator, and other features that improve code quality and performance.
Where can I see examples of the new Card and Knob components?
The PrimeFaces Showcase application is updated with every release to include live demos and code samples for all new components. It's the best resource for seeing them in action.