PrimeFaces Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Partial Processing and Rendering using the Fragment component

The Fragment component can be used to define a segment of components that should be partially processed, and updated when an AJAX request is triggered by any descendant component. This comes in very handy when there are multiple sections of the form with different actions for each segment.

By using fragments, Partial Processing and Rendering becomes very easy because we don't need to specify the component IDs to be processed using the process attribute, and component IDs to be updated using the update attribute.

For example, in the User Account screen we can have User Details and Contact Details sections, each with a command button to update the respective sections' fields.