First page Back Continue Last page Graphics

Using Component Facets


Using Facets

When you begin to use components, you see in the Structure window that many of them contain something called facets. A facet is a placeholder where a developer can add content.

For example, the af:showDetailItem component has a facet called toolbar. As the name suggests, the facet is intended as a placeholder for a toolbar, although you could place any content there.

In the example in the slide, the application developer has added a toolbar component with a toolbarButton to the toolbar facet of showDetailItem and set the button’s text property value to “I’m a button on the toolbar facet!” At run time, that text is displayed at the place designated for the toolbar facet on the showDetailItem component.

It is important to note that a facet can have only one direct child. If the developer adds more buttons to the toolbar facet, they must be added to the direct child of the facet, which is the toolbar component.