h:panelGroup |
|
The panelGroup tag is a container component that renders its child components. It is intended to be used in situations where it is desirable to include several components but when only one child component is allowed, such as within a panelGrid column or a facet component.
The example below demonstrates the use of a panelGroup component to nest two components inside a single panelGrid column. Without the panelGroup component, the two child components of the panelGrid would have been rendered in separate rows.
Example
<h:form id="form">
<h:panelGrid id="grid" columns="1">
<h:panelGroup>
<h:inputText id="username" value="#{userBean.user.username}" required="#{true}" />
<h:message for="username" />
</h:panelGroup>
</h:panelGrid>
</h:form>
HTML Output
<form id="form" name="form" method="post" ... >
<table id="grid">
<tbody>
<tr>
<td><input id="username" name="username" type="text" value=""/> "username": Value is required.</td>
</tr>
</tbody>
</table>
</form>
|