Java Reference
In-Depth Information
F
IGURE
33.13
The user input is collected and displayed after clicking the Register button.
The
h:selectManyCheckbox
element is bound to the
hobby
property (line 63). When
the page is sent to the server, the checked boxes are returned as an array of
itemValues
and
set to the
hobby
property.
The
h:selectTextarea
element is bound to the
remarks
property (line 75). When the
page is sent to the server, the content in the text area is returned as a string and set to the
remarks
property.
The
h:outputText
element is bound to the
response
property (line 82). This is a read-
only property in the bean. It is
""
if
lastName
is
null
(lines 86-87 in Listing 33.5). When
the page is returned to the client, the
response
property value is displayed in the output text
element (line 82).
The
h:outputText
element's
escape
attribute is set to
false
(line 81) to enable the
contents to be displayed in HTML. By default, the
escape
attribute is
true
, which indicates
the contents are considered as regular text.
binding check boxes
binding text area
binding response
escape
attribute
33.11
In the
h:outputText
tag, what is the
escape
attribute for?
33.12
Does every GUI component tag in JSF have the style attribute?
✓
✓
Check
Point
This section gives a case study on using GUI elements and processing forms.
Key
Point
This section uses JSF to develop a calculator to perform addition, subtraction, multiplication,
and division, as shown in Figure 33.14.
Search WWH ::
Custom Search