Java Reference
In-Depth Information
12 <h:form>
13 <h:outputLabel value="Choose a Course: " />
14 <h:selectOneMenu value="#{courseName.choice}">
15 <f:selectItems value="#{courseName.titles}" />
16 </h:selectOneMenu>
17
18 <h:commandButton style="margin-left: 20px"
19 value="Display Students" />
20
21 <br /> <br />
22 <h:dataTable value="#{courseName.students}" var="student"
23 rowClasses="oddTableRow, evenTableRow"
24 headerClass="tableHeader"
25 styleClass="table">
26 <h:column>
27 <f:facet name="header">SSN</f:facet>
28 #{student.ssn}
29 </h:column>
30
31 <h:column>
32 <f:facet name="header">First Name</f:facet>
33 #{student.firstName}
34 </h:column>
35
36 <h:column>
37 <f:facet name="header">MI</f:facet>
38 #{student.mi}
39 </h:column>
40
41 <h:column>
42 <f:facet name="header">Last Name</f:facet>
43 #{student.lastName}
44 </h:column>
45
46 <h:column>
47 <f:facet name="header">Phone</f:facet>
48 #{student.phone}
49 </h:column>
50
51 <h:column>
52 <f:facet name="header">Birth Date</f:facet>
53 #{student.birthDate}
54 </h:column>
55
56 <h:column>
57 <f:facet name="header">Dept</f:facet>
58 #{student.deptId}
59 </h:column>
60 </h:dataTable>
61 </h:form>
62 </h:body>
63 </html>
bind choice
titles
display button
bind result set
rowClasses
headerClass
styleClass
ssn column
firstName column
mi column
lastName column
phone column
birthDate column
deptId column
Line 9 specifies that the style sheet tablestyle.css created in Step 3 is used in this XMTHL
file. The rowClasses = "oddTableRow, evenTableRow" attribute specifies the style
applied to the rows alternately using oddTableRow and evenTableRow (line 23). The
headerClasses = "tableHeader" attribute specifies that the tableHeader class is
used for header style (line 24). The styleClasses = "table" attribute specifies that the
table class is used for the style of all other elements in the table (line 25).
 
Search WWH ::




Custom Search