background image

Using Text Components

<< The style and styleClass Attributes | UIInput and UIOutput Tags >>
<< The style and styleClass Attributes | UIInput and UIOutput Tags >>

Using Text Components

The form tag represents the UIForm component on the page and encloses all the components
that display or collect data from the user, as shown here:
<h:form>
... other JavaServer Faces tags and other content...
</h:form>
The form tag can also include HTML markup to lay out the components on the page. The form
tag itself does not perform any layout; its purpose is to collect data and to declare attributes that
can be used by other components in the form. A page can include multiple form tags, but only
the values from the form that the user submits will be included in the postback.
Using Text Components
Text components allow users to view and edit text in web applications. The basic kinds of text
components are:
Label, which displays read-only text.
Text field, which allows users to enter text, often to be submitted as part of a form.
Password field, which is one kind of text field that displays a set of characters, such as
asterisks, instead of the password that the user enters.
Text area, which is another kind of text field that allow users to enter multiple lines of text.
Figure 11­2
shows examples of these text components.
FIGURE 11­1
A Typical Form
FIGURE 11­2
Example Text Components
Adding UI Components to a Page Using the HTML Component Tags
The Java EE 5 Tutorial · September 2007
330