I need to customize the "No records found." text in p:dataTable. Is there an easy way to do this?
Also, is this text translatable? I need to display an english and french version.
Thanks!
Rob
p:dataTable - how to customize text of "No records found."?
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
I assume you don't have the user's guide?
Use <p:dataTable emptyMessage="....."
You can localize messages by using message/resource bundles. Look on the internet how to do that. If you have set up you use something like this:
<p:dataTable emptyMessage="#{messagebundle.noRows"}
You will make message bundels for all the languages you need.
And.... just buy the manual, it really is not the price of the thing. Primefaces is a real nice set of open source components.
You can localize messages by using message/resource bundles. Look on the internet how to do that. If you have set up you use something like this:
<p:dataTable emptyMessage="#{messagebundle.noRows"}
You will make message bundels for all the languages you need.
And.... just buy the manual, it really is not the price of the thing. Primefaces is a real nice set of open source components.
Resource bundle internationalization..silly questionmichal001 wrote:Also, is this text translatable? I need to display an english and french version.
ohh..see it is replied in previous post also
@gollrich
you need to use emptyMessage attribute for all tables and you can give same styleclass for all tables to look like same through out all tables
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
And to add on to this thread going down a parallel path ...
Is there a way to do parameter substitution on the message all within an EL expression in the error message.
What I would like to use is ...
but instead of the some magic EL code that I have not been able to find after much searching so that a message in the properties file looks like this ...
would end up looking like this "No Cars found" ... obviously "Cars" was the valuable of a variable made available to the EL expression.
Something that does the same as this ... but all in a one line expression as that is all that is available ...
Thanks,
Arvid
Is there a way to do parameter substitution on the message all within an EL expression in the error message.
What I would like to use is ...
Code: Select all
emptyMessage="#{messages.label_no_records_found}"
Code: Select all
"#{messages.label_no_records_found}"
Code: Select all
label_no_records_found=No {0} found
Something that does the same as this ... but all in a one line expression as that is all that is available ...
Code: Select all
<h:outputFormat value="#{messages.label_no_records_found}" >
<f:parm value="Cars" />
</h:outputFormat>
Arvid
- andyba
- Expert Member
- Posts: 2473
- Joined: 31 Mar 2011, 16:27
- Location: Steinfeld, near Bremen/Osnabrück, DE
- Contact:
Look people, Thread Necromancy is not approved of on this Forum.
If you have a question DON'T ASK IT IN A THREAD THAT IS 19 MONTHS OLD!!
Especially if that question has absolutely nothing to do with PrimeFaces: OP, go learn JSF.
If you have a question DON'T ASK IT IN A THREAD THAT IS 19 MONTHS OLD!!
Especially if that question has absolutely nothing to do with PrimeFaces: OP, go learn JSF.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
This is the only correct answer!!! \\n/
-
- Information
-
Who is online
Users browsing this forum: No registered users and 34 guests