Output Panel

Output panel is a container element with several use cases, this example uses an autoUpdate outputPanel to update a component page which doesn't exist on page initially and rendered based on a condition.



Source

<h:form>
	<p:commandButton id="showButton" value="Show">
		<f:setPropertyActionListener value="#{true}" target="#{requestScope.renderCampNou}" />
	</p:commandButton>
	
	<p:outputPanel id="panel" autoUpdate="true">
		<p:graphicImage value="/images/barca/camp_nou.jpg" rendered="#{requestScope.renderCampNou}"/>
	</p:outputPanel>
</h:form>