Skip to Content
Facelets
book

Facelets

by Robert Swarr
March 2007
Beginner to intermediate content levelBeginner to intermediate
101 pages
2h 41m
English
O'Reilly Media, Inc.
Content preview from Facelets

Chapter 5. Developing and Using Facelets Component Tags

5.1 The Facelets Component Tags

Facelets supports two tags that function as components: the aptly named ui:component and its nontrimming counterpart, ui:fragment. These tags are components because both insert a new JSF UIComponent object into the component tree, which becomes the root for all of the tag's child elements. Additionally, both tags support two of the Faces common properties, id and binding. These tags offer a simple mechanism for creating custom components. Facelets and JSF handle the wiring and rendering—all the developer has to do is create a Facelets view using these tags. This chapter describes these tags and their usage, and demonstrates how to use them with some examples.

5.1.1 The component tags: ui:component and ui:fragment

These two tags are a matched set like ui:composition and ui:decorate. The ui:component tag trims all content outside of itself, and the ui:fragment tag has the same behavior, except it is nontrimming.

ui:component

This tag behaves much like the ui:composition tag. The difference is that the ui:component tag inserts a new UIComponent instance into the component tree as the root of all of its child elements. The ui:component tag supports both the id and binding attributes, which perform their typical functions. The id attribute can be used to assign this component an identifier. If you do not assign an identifier, Faces will. The binding attribute can be used to bind to any of the children ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java™ Performance

Java™ Performance

Charlie Hunt, Binu John
JavaServer Faces

JavaServer Faces

Hans Bergsten
Core JavaServer™ Faces

Core JavaServer™ Faces

David Geary, Cay S. Horstmann

Publisher Resources

ISBN: 9780596529246Publisher SupportErrata PageSupplemental Content