Understanding partial page rendering (PPR)
PrimeFaces provides a generic partial page rendering (PPR) mechanism to update specific JSF components with AJAX.
PrimeFaces provides process, update
attributes to indicate which view components need to be processed or updated. Partial processing also provides some keywords which has some special meaning.
Keyword |
Description |
---|---|
|
Component that triggers the PPR is processed. |
|
Parent of the PPR trigger is processed. |
|
Encapsulating form of the PPR trigger is processed. |
|
Encapsulating naming container. |
|
No component is processed, useful to revert changes to form. |
|
Whole component tree is processed just like a regular request. |
Sometimes, we may need to process the form partially based on the action triggered on the form. A very common scenario is, there can be multiple submit buttons in a form and you need to perform validations based on the action performed and ignore other field validations that are irrelevant to the action invoked.
For example, assume we are viewing a User Detail Form and we can update the user details or delete the user record using Update and Delete submit buttons. For updating, the user fields, userId
, userName
, and firstName
are mandatory where as for deleting, only userId
is required. So, when the Update button is clicked, validations should be performed on userId
, userName
, and firstName
fields. But when the Delete button is clicked, validations on userName
and firstName
should be skipped.