Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

Mario Tigua

Greenhorn
+ Follow
since Dec 09, 2010
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mario Tigua

Hi to everyone!

I have a sorted rich:datatable with a subtable, but I have to put subheaders. How can I do this? I have attached an image that shows my problem.

This is my current code:

<rich:dataTable
id="tablaDocumentosBandejaEntrada" rows="20" styleClass="resultados"
onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
cellpadding="1" cellspacing="1" width="100%"
value="#{reporte.documentoEnBandejaEntrada}"
var="documentoEnBandejaEntrada"
rendered="#{reporte.documentoEnBandejaEntrada != null}"
rowClasses="impar"
>

<rich:column rowspan="#{documentoEnBandejaEntrada.expedientesAsociadosADocumento.size()+1}">
<f:facet name="header">
<h:outputText value="Ver Expediente" />
</f:facet>
<a4j:commandButton id="verExpediente" alt="Ver Expediente" image="/img/ver_detalle_01.gif" action="#{verExpedienteDesdeReporte.begin()}"
rendered="#{reporte.renderedVerExpediente(documentoEnBandejaEntrada.idDocumento)}">
<f:param name="idExpediente" value="#{reporte.obtenerIdExpediente(documentoEnBandejaEntrada.numeroExpediente)}" />
<f:param name="bandejaEntradaCopia" value="false" />
</a4j:commandButton>
</rich:column>

<rich:column rowspan="#{documentoEnBandejaEntrada.expedientesAsociadosADocumento.size()+1}">
<f:facet name="header">
<h:outputText value="Ver Documento" />
</f:facet>
<a4j:htmlCommandLink immediate="true" border="0px" target="_blank" action="#{visualizador.verDocumento(documentoEnBandejaEntrada.idDocumento)}"
rendered="#{reporte.renderedVisualizarExpediente(documentoEnBandejaEntrada.idDocumento)}">
<h:graphicImage border="0px" alt="#{documentoEnBandejaEntrada.idDocumento}" url="/img/icono_visualizar_doc_adjunto.gif" />
</a4j:htmlCommandLink>
</rich:column>

<rich:column
sortable="true" sortBy="#{documentoEnBandejaEntrada.tipoDocumento}"
rowspan="#{documentoEnBandejaEntrada.expedientesAsociadosADocumento.size()+1}">
<f:facet name="header">
<h:outputText value="Tipo Documento" />
</f:facet>
<h:outputText value="#{documentoEnBandejaEntrada.tipoDocumento}" />
</rich:column>

...................................

<rich:column colspan="5" style="vertical-align: top;">
<f:facet name="header">
<h:outputText value="Datos de Bandeja" /> <!-- This is the main header but I have to put subheaders! -->
</f:facet>
<rich:subTable id="tablaDocumentosBandejaEntrada" styleClass="resultados" onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" cellpadding="1" cellspacing="1" width="100%" var="expedienteAsociado"
value="#{documentoEnBandejaEntrada.expedientesAsociadosADocumento}">
<rich:column>
<h:outputText value="#{expedienteAsociado.destinatario.cargo.unidadOrganizacional.descripcion}" />
</rich:column>
<rich:column> <h:outputText value="#{expedienteAsociado.destinatario.cargo.descripcion}" />
</rich:column>
<rich:column> <h:outputText value="#{expedienteAsociado.destinatario.getNombreApellido()}" />
</rich:column>
<rich:column> <h:outputText value="#{expedienteAsociado.fechaDespacho}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm" locale="#{reporte.locale}" timeZone="#{reporte.timeZone}" />
</h:outputText>
</rich:column>
<rich:column>
<h:outputText value="#{expedienteAsociado.fechaAcuseRecibo}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm" locale="#{reporte.locale}" timeZone="#{reporte.timeZone}" />
</h:outputText>
</rich:column>
</rich:subTable>
</rich:column>
</rich:dataTable>

Columns in subtable donĀ“t have to be sorted.

Thanks in advance!

11 years ago
JSF