Primefaces p: dataTable changing default message "No records found."?

0

And I have a p: dataTable:

<p:dataTable var="ind" value="#{logIndPersistBean.list}" paginator="true" rows="10"
                        id="table"  rowStyleClass="odd-row, even-row">

                        <f:facet name="header">
                            Lista de Log
                        </f:facet>

                        <p:column headerText="Name" >
                            <h:outputText value="#{ind.name}"/>
                        </p:column>

                        <p:column headerText="Date" >
                            <h:outputText value="#{ind.date}" />
                        </p:column>

                        </p:column>

                </p:dataTable>

When I run a new search, if I do not return any records, the dataTable displays the message "No records found." Is there any way I do not have to display this message, just the empty list?

I know I only need to add emptyMessage="", but I want to change the default message, ie instead of "No records found." to "Your search did not return anything" or simply "".

Is there any way to change this default message?

I'm using 4.0 primefaces.

Thank you in advance!

    
asked by anonymous 20.08.2015 / 21:41

2 answers

1

With this CSS you make the default line disappear:

.ui-widget-content .ui-datatable-empty-message{
   display: none;
}

There is no easy way to change the default message without changing the source code of Primefaces, only with small hacks.

    
20.08.2015 / 21:55
0

"Simple" my brother, just insert into your datatable emptyMessage Inside the emptyMessage you put the message you want. example

<p:dataTable id="table" value="#{bean.list}" var="obj"  emptyMessage="Nenhum Registro Encontrado" style="width:100%">

Hugs!

    
20.08.2015 / 22:07