What Is New in PrimeFaces 5.1
PrimeFaces 5.1 delivers a significant update focused on new components, major feature enhancements, and a suite of bug fixes. This release strengthens the component library and improves the overall developer experience. Here's a high-level summary of the key changes.
| Category | Key Items |
|---|---|
| New Components | Knob, InputGroup, InputMask, Terminal |
| New Features | Touch support, Responsive DataTable, Dialog Framework improvements |
| Improvements | Client-side API, Mobile enhancements, ThemeRoller |
| Bug Fixes | Over 150 issues resolved across the suite |
What new components were introduced?
PrimeFaces 5.1 adds four new components to its arsenal. The p:knob is a new input component for selecting a numeric value through a dial interface. The p:inputGroup allows for easy grouping of addons and buttons alongside input fields.
We also got p:inputMask, which provides a user-friendly way to enforce input formatting for things like phone numbers. Finally, the p:terminal component offers a command-line interface emulator, which is great for building admin panels.
How was mobile and touch support improved?
Touch support was a major theme in this release. Components like Schedule, Charts, and Draggable/Droppable now have native touch event support for a seamless experience on mobile devices.
The DataTable received a responsive mode, making it automatically adapt its layout on smaller screens. These changes make building cross-platform applications that work well on both desktop and mobile much more straightforward.
What are the key Dialog Framework enhancements?
The Dialog Framework (DF) got more powerful with several new options. You can now make dialogs modal, resizable, and draggable directly from the navigation case definition in your faces-config.xml.
This means you have much finer control over the behavior and appearance of dialogs without having to write extra code. It streamlines the process of creating complex dialog-based workflows.
Were there any Client-Side API updates?
Yes, the client-side API saw useful additions. New methods like PrimeFaces.getWidgetById() and WidgetVar.getAsString() were introduced.
These methods make it easier to interact with components from JavaScript, improving the integration between your client-side scripts and the PrimeFaces component system.
FAQ
Is the InputMask component a replacement for the old mask validation?
Yes, the new p:inputMask component is the recommended approach for input masking. It provides a much better user experience compared to the old client-side validator mask.
How do I enable the new responsive mode for DataTable?
You enable it by setting the responsive attribute to true on your p:dataTable component. The table will then automatically adjust its layout on smaller viewports.
What is the main use case for the Terminal component?
The p:terminal is ideal for building command-line interfaces within a web application, such as admin panels or system monitoring tools where users need to execute specific commands.
Does the new touch support require any additional configuration?
No, the touch support for components like Schedule and Charts is built-in and works automatically on capable devices without any extra setup from the developer.
Where can I see the full list of bug fixes?
The complete list of over 150 resolved issues is available in the release notes on GitHub. It covers fixes for specific components like DataTable, Tree, and FileUpload.