Java Reference
In-Depth Information
Line 14 binds the
choice
property in the
courseName
bean with the combo box. The
selection values in the combo box are bound with the
titles
array property (line 15).
Line 22 binds the table value with a database result set using the attribute
value="#{courseName.students}"
. The
var="student"
attribute associ-
ates a row in the result set with
student
. Lines 26-59 specify the column values using
student.ssn
(line 28),
student.firstName
(line 33),
student.mi
(line 38),
student.lastName
(line 33),
student.phone
(line 48),
student.birthDate
(line 53),
and
student.deptId
(line 58).
L
ISTING
33.15
tablestyle.css
1 /* Style for table */
2 .tableHeader {
3 font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
4 border-collapse:collapse;
5 font-size:1.1em;
6 text-align:left;
7 padding-top:5px;
8 padding-bottom:4px;
9 background-color:#A7C942;
10 color:white;
11 border:1px solid #98bf21;
12 }
13
14 .oddTableRow {
15 border:1px solid #98bf21;
16 }
17
18 .evenTableRow {
19 background-color: #eeeeee;
20 font-size:1em;
21
22 padding:3px 7px 2px 7px;
23
24 color:#000000;
25 background-color:#EAF2D3;
26 }
27
28 .table {
29 border:1px solid green;
30 }
tableHeader
oddTableRow
evenTableRow
table
The style sheet file defines the style classes
tableHeader
(line 2) for table header style,
oddTableRow
for odd table rows (line 14),
evenTableRow
for even table rows (line 18), and
table for all other table elements (line 28).
You can open new JSF pages from the current JSF pages.
Key
Point
All the examples you have seen so far use only one JSF page in a project. Suppose you want to
register student information to the database. The application first displays the page as shown
in Figure 33.22 to collect student information. After the user enters the information and clicks
the
Submit
button, a new page is displayed to ask the user to confirm the input, as shown in
Figure 33.23. If the user clicks the
Confirm
button, the data are stored into the database and
the status page is displayed, as shown in Figure 33.24. If the user clicks the
Go Back
button,
it goes back to the first page.
Search WWH ::
Custom Search