PrimeFaces 3.3 development has begun fast and furious! Starting with the new partial submit feature, we are glad to introduce another extension feature to Ajax Framework called PrimeFaces Selector API in short PFS.
PFS integrates jQuery Selector API with JSF component referencing model, so for partial update and process, referencing JSF components can be done using jQuery Selector API instead of regular JSF model which is based on UIComponent.findComponent.
So how does it work? Syntax is @(selector), here are a couple of examples;
Update all forms
Update first form
Update all components that has “mystyle” style class
Update and process all inputs
Update all datatables
Process input components inside panel and update panel
process="@(.ui-panel :input)" update="@(.ui-panel)"
Process input components but not select components
Process input components that are disabled
Sky is the limit with this feature, see the jQuery Selector API docs for more information.
Please note that PFS is an additional feature, backward compatible and can be used with regular referencing, so following is also possible;
update="compId :form:compId @(:input)"
In summary, PFS provides an alternative, flexible, grouping based approach to reference components to partially process and update. There is less CPU server load compared to regular referencing because JSF component tree is not traversed on server side to find a component and figure out the client id as PFS is implemented on client side by looking at dom tree. Another advantage is avoiding naming container limitations, just remember the times you’ve faced with cannot find component exception since the component you are looking for is in a different naming container like a form or a datatable. PFS can help you out in tricky situations by following jQuery’s “write less do more” style.
Always Bet On Prime!