Java Reference
In-Depth Information
<h:outputLabel for="age" value="Age:"/>
<h:inputText id="age" label="Age" size="2"
value="#{RegistrationBean.age}"/>
<h:message for="age"/>
<!-- Fifth row begins here -->
<h:outputLabel value="Email Address:" for="email"/>
<h:inputText id="email" label="Email Address"
required="true"
value="#{RegistrationBean.email}" />
<h:message for="email" />
<!-- Sixth row begins here -->
<h:panelGroup/>
<h:commandButton id="register" value="Register"
action="submit" />
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
The following screenshot illustrates how our page will be rendered at runtime:
All JSF input fields must be inside a <h:form> tag. The <h:panelGrid> helps us
to easily align JSF tags in our page. It can be thought of as a grid where other JSF
tags will be placed. The columns attribute of the <h:panelGrid> tag indicates how
many columns the grid will have, each JSF component inside the <h:panelGrid>
component will be placed in an individual cell of the grid, when the number of
components matching the value of the columns attribute (three in our example) has
been placed inside <h:panelGrid> , a new row is automatically started.
 
Search WWH ::




Custom Search