Is there any way to prevent an h:datatable from creating an empty row when the backing value is empty? More specifically: I have a collection of data to be displayed in 3 co
Thanks for BalusC's suggestion, but I tried it, it did not work. It may be other reasons result in. I fixed BalusC's code a little, it works now:
table.locations.empty tbody td {
border-color: rgba(0, 0, 0, 0);
}
Specify a separate style for an empty table. E.g.
table.empty tbody td {
border: 0;
}
And add it conditionally.
<h:dataTable ... styleClass="locations #{empty component.value ? 'empty' : ''}">
You might be able to avoid the column header disapearing if you instead wrap your method in an outputText tag
Example:
<h:column>
<!-- column header -->
<f:facet name="header">Address</f:facet>
<!-- row record -->
<h:outputText value="#{nearestLoc.affffdress}" />
</h:column>
This way the column itself does not depend on the values