h:panelGrid only controls the layout of its own children (and not the children of its children)<foo:exampleTag /> ( ).
h:panelGrid, .
, h:panelGrid ui:include:
<h:panelGrid columns="2">
<ui:include src="gridme.xhtml">
<ui:param name="foo" value="Hello,"/>
<ui:param name="bar" value="World!"/>
</ui:include>
<ui:include src="gridme.xhtml">
<ui:param name="foo" value="Hello,"/>
<ui:param name="bar" value="Nurse!"/>
</ui:include>
</h:panelGrid>
composition :
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
<h:outputText value="#{foo}" />
<h:outputText value="#{bar}" />
</ui:composition>
:
<table>
<tbody>
<tr>
<td>Hello,</td>
<td>World!</td>
</tr>
<tr>
<td>Hello,</td>
<td>Nurse!</td>
</tr>
</tbody>
</table>
- - gridme.xhtml, , , NamespaceContainer, .
.
public void encodeBegin(FacesContext context) throws IOException {
getChildren().add(new HtmlLabel());
getChildren().add(new HtmlOutputText();
}
. , , . ; . ; (. ) .