ui:fragment |
|
The UI Fragment tag inserts a new UIComponent instance into the JSF
component tree. Any components or content fragments outside this tag will be
included by the Facelets view handler. Any components or content fragments
within this tag will be added to the component tree as children of this
component instance. See also ui:component.
fragment.jsf
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<body>
<h:form>
This text will be included.
<ui:fragment binding="#{myController.component}">
<div id="message">
Hello World!
</div>
</ui:fragment>
This text will be included.
</h:form>
</body>
</html>
This example was formatted by JSFToolbox for Dreamweaver.
Rendered Output
HTML Output
This text will be included.
<div id="message">Hello World!</div>
This text will be included.
|