ui:define

ui:define can create sections inside a template that is using any of ui:component, ui:composition, ui:decorate or ui:fragment.

General Usage

To define names for each section, it's mandatory to use name attribute. For inserting content into these sections, use ui:insert.


INSERTED TEXT

Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

	<ui:decorate template="template.xhtml">
		<ui:define name="defineContent">
			<br/><br/>INSERTED TEXT
		</ui:define>
	</ui:decorate>

</ui:composition>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html">
    
   	<ui:insert name="defineContent">
   		   	<h:outputText value="#{i18n['this-text-comes-from-a-template']}"/>
   	</ui:insert>
</ui:composition>
Liferay Faces Bridge Implementation 5.0.0 + Liferay Faces Portal 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20