• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Edson Cezar
Ranch Hand
Posts: 119
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a p:dataTable:



When i start a new search, if none register returns, the dataTable show a message "No records found.", is there a way to a dataTable just show a empty message, only the empty list ?

I know is possible just Add emptyMessage="" to your data table attributes.

I want to change de default message in every p:dataTable, is it possible, instead "No records found." change this message to "Your query returned no record." or just changing the default value for "".

If it's relevant i'm using primefaces 4.0



Thanks in advance.
 
Jason Jia
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Three ways:
1. Change Primefaces.
2. Develop a composite component which wrap the P:datatable and change the emptymessage to what you what.
3. Use <ui:include> (replace p:datatable) and <ui:composition> (wrapping). It's essentially same as 2, but easier.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
4. Check your resources and you'll probably find that PrimeFaces has a standard set of message properties in order to facilitate I18N. Override the "no records" default text property.
 
Edson Cezar
Ranch Hand
Posts: 119
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all, was really helpfull

I found another solution, just changing the css:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!