10. Facelets UI Tag Reference
Contents > Facelets UI Tag Reference > ui:decorate
ui:decorate |
|
The UI Decorate tag is a templating tag that decorates content included from another Facelet. Any content outside of the UI Decorate tag will be displayed by the Facelets view handler. Any content within the decorate tag will be passed to the associated template as parameters or simply ignored. You can use nested ui:define tags to pass named content to the associated template. See ui:insert for more information.
Templating Tip:
The content of the page containing the decorate tag is be used to populate an associated template page. If the decorate tag contains ui:define tags, the content of these tags will be inserted into the template where matching ui:insert tags can be found. You can use a nameless ui:insert tag to insert all the content of the composition tag within the template page.
Example:
<p><strong>template.jsf</strong></p>
This text will be removed.
<ui:composition>
<h2><ui:insert name="title" /></h2>
<ui:insert name="body" />
</ui:composition>
This text will be removed.
<p><strong>decorate.jsf</strong></p>
Text before will stay.<br />
<ui:decorate template="template.jsf">
<ui:define name="title">Our Products</ui:define>
<ui:define name="body">
<ul>
<li>Apples</li>
<li>Oranges</li>
<li>Bananas</li>
</ul>
</ui:define>
</ui:decorate>
Text after will stay.
HTML Output
<p><strong>decorate.jsf</strong></p>
Text before will stay.<br />
<h2>Our Products</h2>
<ul>
<li>Apples</li>
<li>Oranges</li>
<li>Bananas</li>
</ul>
Text after will stay.
|
Tag Attributes
| template |
String |
| Required |
| The absolute or relative URI of the template to use. The content within the decorate tag will be used in populating the template specified. |
|