aspose file tools*
The moose likes JSF and the fly likes Problem with headers in sorted rich:datatable with subtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem with headers in sorted rich:datatable with subtable" Watch "Problem with headers in sorted rich:datatable with subtable" New topic
Author

Problem with headers in sorted rich:datatable with subtable

Mario Tigua
Greenhorn

Joined: Dec 09, 2010
Posts: 1
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">
<hutputText 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">
<hutputText 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">
<hutputText value="Tipo Documento" />
</f:facet>
<hutputText value="#{documentoEnBandejaEntrada.tipoDocumento}" />
</rich:column>

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

<rich:column colspan="5" style="vertical-align: top;">
<f:facet name="header">
<hutputText 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>
<hutputText value="#{expedienteAsociado.destinatario.cargo.unidadOrganizacional.descripcion}" />
</rich:column>
<rich:column> <hutputText value="#{expedienteAsociado.destinatario.cargo.descripcion}" />
</rich:column>
<rich:column> <hutputText value="#{expedienteAsociado.destinatario.getNombreApellido()}" />
</rich:column>
<rich:column> <hutputText value="#{expedienteAsociado.fechaDespacho}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm" locale="#{reporte.locale}" timeZone="#{reporte.timeZone}" />
</hutputText>
</rich:column>
<rich:column>
<hutputText value="#{expedienteAsociado.fechaAcuseRecibo}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm" locale="#{reporte.locale}" timeZone="#{reporte.timeZone}" />
</hutputText>
</rich:column>
</rich:subTable>
</rich:column>
</rich:dataTable>

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

Thanks in advance!



[Thumbnail for BusquedaEntrada.png]

 
 
subject: Problem with headers in sorted rich:datatable with subtable