The jQuery library has great support for selecting DOM elements based on various criteria such as ID, name, or CSS class and so on.
Following are a few examples on how to use jQuery Selectors to select DOM elements:
$("p")
: All<p>
elements$("#userId")
: The element withid="userId"
$(".navbar")
: All elements withclass="navbar"
PrimeFaces has integration with the jQuery Selector API for referencing JSF component models. So you can use the jQuery Selector API to choose components to be processed or updated.
In most of the scenarios, using the jQuery Selector API for finding UI components yields better performance as the components are picked by navigating through the DOM tree on the client side instead of navigating through the JSF component tree on the server side and hence reduce the load on the server.
You can give a selector expression to update and process UI components using the following syntax:
process="@(expression)" update="@(expression)"
For example...