dev@jsftemplating.java.net

Re: facet?

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Tue, 12 Sep 2006 13:27:09 -0700

In JSF a "facet" allows you to provide a UIComponent to another
UIComponent as a means of customizing it. For example, the TreeNode
component has a few properties to help you define the Hyperlink that it
encapsulates:

<sun:treeNode text="link text" url="link url" />

The TreeNode also provides a facet by the name of "content" that allows
you to provide your own Hyperlink (or any other UIComponent) to use
instead of the "default" one that it will generate automatically:

<sun:treeNode>
<!facet content>
<sun:hyerlink .../>
</facet>
</sun:treeNode>

You might choose to use buttons, images, multiple hyperlinks, etc. This
provides an extension point to make the components more flexible without
having to plan ahead for everything when writing the component itself.

Ken

Senthil Chidambaram wrote:
> Ken,
> I see in our jsf files using <!facet>, why do we use this, or what is
> the significance of this.
>
> thx
> Senthil