Primefaces datatable duplicate "No records found" while doing column freeze for empty records

581 views Asked by At

I am using primefaces <p:datatable> to freeze some of my columns.Everything is fine but when there are no records in then it gives two "No records found" message.This is weird situation.Do anyone have come across this problem? Suggestions are welcome.I want only one "No records found " message.

        <p:dataTable var="car" value="#{dtBasicView.cars}" scrollable="true"
            frozenColumns="3" rows="10" paginator="true" paginatorTemplate="     {CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" scrollHeight="400">

            <p:column width="50" headerText="Id">
                <h:outputText value="#{car.randomId}" />
            </p:column>

            <p:column width="50" headerText="Year">
                <h:outputText value="#{car.randomYear}" />
            </p:column>
           //...................
</p:datatable>

Custome message also don't work as they also appears twice.

1

There are 1 answers

0
Rajesh On BEST ANSWER

I didn't find any solution to above problem.So, I manually overrided the css of second table generated by the above p:datatable.

My css is:

<style>
      .ui-datatable-frozenlayout-right .ui-datatable-empty-message td
     {
      display: none;
      //or visibility:hidden;
     } 
</style>