Change fileLimit error message in p:fileUpload

UI Components for JSF
Post Reply
devmsaleh
Posts: 50
Joined: 06 Aug 2012, 11:43

26 Aug 2014, 07:52

Hi, i was wondering if it's possible to change the fileLimit error message in p:fileUpload, because i want to read it from property file based on user locale, please advise if that is possible and how it can be done, thanks.

daniender
Posts: 3
Joined: 26 Aug 2014, 08:50

26 Aug 2014, 09:04

What version of PF are you using?

At least in current version (PF 5) there's a property in <p:fileUpload/> tag called "fileLimitMessage" that can be used with properties message ("#{msg['foo.message']}").
PrimeFaces 5.0
PrimeFaces Extensions 2.0.0
JSF 2.0
Mojarra 2.2.0
Glassfish 4.0.1

daniender
Posts: 3
Joined: 26 Aug 2014, 08:50

26 Aug 2014, 09:05

What version of PF are you using?

At least in current version (PF 5) there's a property in <p:fileUpload/> tag called "fileLimitMessage" that can be used with properties message ("#{msg['foo.message']}").
PrimeFaces 5.0
PrimeFaces Extensions 2.0.0
JSF 2.0
Mojarra 2.2.0
Glassfish 4.0.1

Mathieu-Castets
Posts: 45
Joined: 03 Jul 2014, 19:04
Location: Biarritz, France

26 Aug 2014, 10:00

There is an

Code: Select all

invalidSizeMessage
properties for the p:fileUpload component.
invalidSizeMessage null String Message to display when size limit exceeds.
Page 203 - Primefaces user guide (5.0)

Here's a snippet of one of my component:

Code: Select all

<p:fileUpload fileUploadListener="#{fileController.handleSingleFileUpload}" mode="advanced" auto="true" sizeLimit="#{app['MAX_FILE_SIZE']}" allowTypes="/(\.|\/)(pdf|doc|docx|jpe?g|png)$/" label="#{msg['file.choose']}" update="tempFile, :growl" invalidSizeMessage="#{msg['file.doc.size']}" invalidFileMessage="#{msg['file.doc.invalid']}" uploadLabel="#{msg['file.new']}" />
PrimeFaces 5.3 - PF Extensions 4.0.0 - OmniFaces 2.2 - Mojara 2.2.12 - GlassFish 4.1.1 - Java 7 - Netbeans 8.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests