PPR - Partial Tree Process

You can choose which components to process in JSF lifecycle using the process attribute. This is very useful to do partial validations, model update, invoke application and more. This simply makes immediate, subforms and regions obselete. Keywords like @this, @form, @all, @none, @parent makes it even easier to choose what to process. just for ajax. Following example demonstrates several combinations.

Partial Process

Source

<h:form id="form">
	
	<p:panel header="Partial Process">
		
		<h:panelGrid id="grid" columns="2" style="margin-bottom:10px">
			<f:facet name="header">
				<p:messages />
			</f:facet>
		
			<h:outputLabel for="firstname" value="Firstname:" />
			<p:inputText id="firstname" 
						value="#{personBean.firstname}" />
					
			<h:outputLabel for="surname" value="Surname: *" />
			<p:inputText id="surname" 
						value="#{personBean.surname}" required="true" 
						requiredMessage="Surname is required."/>
		</h:panelGrid>
		
	</p:panel>
	
	<h:panelGrid columns="6" cellpadding="5">
		<p:commandButton value="All" id="btnAll" process="@all" update="grid" 
					actionListener="#{personBean.savePerson}"/>
		<p:commandButton value="Form" id="btnForm" process="@form" update="grid" 
					actionListener="#{personBean.savePerson}"/>
		<p:commandButton value="This" id="btnThis" process="@this" update="grid" 
					actionListener="#{personBean.savePerson}"/>
		<p:commandButton value="None" id="btnNone" process="@none" update="grid" 
					actionListener="#{personBean.savePerson}"/>
		<p:commandButton value="Parent" id="btnParent" process="@parent" update="grid" 
					actionListener="#{personBean.savePerson}"/>
		<p:commandButton value="This Surname" id="btnSurname" process="@this,surname" update="grid" 
					actionListener="#{personBean.savePerson}"/>
	</h:panelGrid>

</h:form>