16.3.1 User interface component classes
The UIComponent interface defines the contract between a UI component and the JSF implementation. This interface must be implemented by every UI component, either directly or indirectly.
The JSF implementation provides base implementation class to this interface, called UIComponentBase. This class defines the default state and behavior of a UI component. It is recommended that you extend the UIComponentBase class, rather than implement the UIComponent interface directly, to minimize the impact of any future changes to the UIComponent interface to your application.
The UI component classes included with JSF technology are:
| UIColumn, which represents a column in a UIData component.
|
| UICommand, which represents a control that performs actions when the user activate it.
|
| UIData, which represents a data binding to a collection of data represented by a DataModel instance.
|
| UIForm, which represents an input form.
|
| UIGraphic, which displays an image.
|
| UIInput, which represents a component that gets and displays user input.
|
| UIMessage, which displays a localized message.
|
| UIMessages, which displays a set of localized messages.
|
| UIOutput, which displays data output.
|
| UIPanel, which is a container to child components.
|
| UIParameter, which represents substitution parameters used to configure parent components.
|
| UISelectBoolean, which represents a component that have a boolean value.
|
| UISelectItem, which represents a single select item for select components.
|
| UISelectItems, which represents an entire set of items.
|
| UISelectMany, which represents a component that allows the user to select zero or more values from a set of values.
|
| UISelectOne, which represents a component that allows the user to select zero or one value from a set of values.
|
| UIViewRoot, which represents the root of the component tree.
|
The component classes also implement one or more behavioral interfaces, each of one defines a different behavior for a set of components whose classes implement it. These interfaces are as follows:
| ActionSource: By implementing this interface, the component is able to fire an action event.
|
| EditableValueHolder: This interface extends ValueHolder and specifies additional features for editable components, such as validation and emitting value-change events.
|
| NamingContainer: Each component rooted at the component that implements this interface must have a unique ID.
|
| StateHolder: Indicates that the component has state that must be saved between requests.
|
| ValueHolder: Denotes that the component maintains a local value as well as the option of accessing data in the model tier.
|
You only need to use the component classes and behavioral interfaces if you are a component writer. Otherwise, you only need to know the appropriate tags that will instruct the JSF implementation on how to render a specific component. These tags are covered in the next section.
|