JSF Showcase
ui:decorate
Very similar to ui:composition, ui:decorate Facelet can add content to the current JSF page, but will add all the external elements to it (just the opposite as ui:composition does).General Usage
For templating reusing, you can usetemplate
attribute pointing to a JSF page.
This text will be rendered This text will be rendered too This text comes from a template
Source Code
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> <h:outputText value="#{i18n['this-text-will-be-rendered']}"/> This text will be rendered too <ui:decorate template="template.xhtml"/> </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"> <h:outputText value="#{i18n['this-text-comes-from-a-template']}"/> </ui:composition>
Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20