JSF-RICHFACES Usar dois footers na mesma dataTable

0 respostas
Ramon_Sim

Tenho uma tabela em que no footer pretendo colocar o resultado de um cálculo, mas preciso também ter outro footer para o datascroller.

Procurei pela internet e achei isso:

The solution I ended up using was a custom renderer associated with t:datatable (the tomahawk extension to datatable)

public class HtmlMultiHeadTableRenderer extends HtmlTableRenderer

I only had to override one method

protected void renderFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component, boolean header)

with in which I looked for facets with names header, header2, header3 … headerN (I stop looking as soon as there is one missing) and the same with footer. This has allowed me do do code like

<h:dataTable ... var="row"> <h:column> <f:facet name="header"> Header </f:facet> <f:facet name="header2"> A second Tr with th's </f:facet> <h:outputText value="#{row.value}"/> <f:facet name="footer"> FirstFooter </f:facet> <f:facet name="footer2"> Second Footer in a new tr </f:facet> </h:column> </h:dataTable>

This took about one day(with some other extensions like allowing colspans based on groups) to code and document

Isso não está muito claro como funciona!

Alguém poderia me ajudar em entender melhor ou mostrar alguma outra solução?

VLW

Criado 4 de outubro de 2010
Respostas 0
Participantes 1