Java Reference
In-Depth Information
30 <h:selectOneRadio id="genderSelectOneRadio">
31 <f:selectItem itemValue="Male"
32 itemLabel="Male"/>
33 <f:selectItem itemValue="Female"
34 itemLabel="Female"/>
35 </h:selectOneRadio>
36 </h:panelGrid>
37
38 <!-- Use combo box and list -->
39 <h:panelGrid columns="4">
40 <h:outputLabel value="Major "/>
41 <h:selectOneMenu id="majorSelectOneMenu">
42 <f:selectItem itemValue="Computer Science"/>
43 <f:selectItem itemValue="Mathematics"/>
44 </h:selectOneMenu>
45 <h:outputLabel value="Minor "/>
46 <h:selectManyListbox id="minorSelectManyListbox">
47 <f:selectItem itemValue="Computer Science"/>
48 <f:selectItem itemValue="Mathematics"/>
49 <f:selectItem itemValue="English"/>
50 </h:selectManyListbox>
51 </h:panelGrid>
52
53 <!-- Use check boxes -->
54 <h:panelGrid columns="4">
55 <h:outputLabel value="Hobby: "/>
56 <h:selectManyCheckbox id="hobbySelectManyCheckbox">
57 <f:selectItem itemValue="Tennis"/>
58 <f:selectItem itemValue="Golf"/>
59 <f:selectItem itemValue="Ping Pong"/>
60 </h:selectManyCheckbox>
61 </h:panelGrid>
62
63 <!-- Use text area -->
64 <h:panelGrid columns="1">
65 <h:outputLabel>Remarks:</h:outputLabel>
66
h:selectOneRadio
f:selectItem
h:selectOneMenu
h:selectManyListBox
h:selectMany Checkbox
<h:inputTextarea id="remarksInputTextarea"
h:inputTextarea
67
style="width:400px; height:50px;" />
68 </h:panelGrid>
69
70 <!-- Use command button -->
71 <h:commandButton value="Register" />
72 </h:form>
73 </h:body>
74 </html>
h:commandButton
jsf core xmlns
The tags with prefix
f
are in the JSF core tag library. Line 6
xmlns:f="http://xmlns.jcp.org/jsf/core">
locates the library for these tags.
The
h:graphicImage
tag displays an image in the file usIcon.gif (line 14). The file is
located in the /resources/image folder. In JSF 2.2, all resources (image files, audio files, CCS
files) should be placed under the resources folder under the
Web Pages
node. You can create
these folders as follows:
h:graphicImage
Step 1: Right-click the Web Pages node in the project pane to display a context menu and
choose
New
,
Folder
to display the New Folder dialog box. (If Folder is not in the context
menu, choose
Other
to locate it.)
Search WWH ::
Custom Search