suppose
a) message resource file with two entries:
key.row = <b> </TD> </TR> <TR> <td (ignore spaces)
key.gt = >
b) row.xhtml
<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" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" > <c:forEach begin="0" end="#{colspan-2}"> <h:panelGroup /> </c:forEach> <h:panelGroup> <h:outputText value="#{i18n['key.row']}" escape="false" /> <h:outputText value=" colspan='#{colspan}' #{cellAttributes}" /> <h:outputText value="#{i18n['key.gt']}" escape="false" /> <ui:insert /> </h:panelGroup> </ui:composition>
then for example
<h:panelGrid columns="3"> <h:outputText value="r1-c1" /> <h:outputText value="r1-c2" /> <h:outputText value="r1-c3" /> <ui:decorate template="/row.xhtml"> <ui:param name="colspan" value="3" /> <ui:param name="cellAttributes" value=" align='center'" /> <div>Hello!!!!!</div> </ui:decorate> </h:panelGroup>
prints a table with three rows:
1) r1-c1, r1-c2, r1-c3
2) 3 empty cells
3) a cell-aligned center having a cap 3 and containing hi-div.
V.
V. Petropoulos May 10 '11 at 16:28 2011-05-10 16:28
source share