Providing user feedback on fileUpload failures

UI Components for JSF
Post Reply
matthew_dunlap
Posts: 3
Joined: 22 Mar 2018, 21:25

22 Mar 2018, 22:59

Hello!

Our project is trying to improve our fileUpload process so when a file upload fails, the user is provided better information about the failure (e.g. the error code). We were hoping to provide this error information inside the file upload, similar to the validation errors. This seems to be more complicated than we hoped, as the only way to do so is to create a custom validator, have fileUpload:onError trigger javascript to collect the error and pass it back via a remote command, and then hack the validator to present what we want.

Our project is open-source and we had a contributor provide a javascript solution to the problem, but we try to stay light on javascript and would like to find a different solution. It can be seen here tho https://github.com/IQSS/dataverse/issues/4511 / https://github.com/IQSS/dataverse/pull/4522/files

Maybe we are missing something? Is there a way to provide this error information inside fileUpload? What do y'all recommend as the best way to achieve this functionality? Note that the main fileUpload process we are targeting is for multiple files uploaded at once and we'd like to cleanly provide information about the multiple files.
Primefaces 6.2 / JSF 2.2 / Glassfish 4.1

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

26 Mar 2018, 16:32

If you, via some small javascript, move the message component client-side into the fileupload. You might just get the message there.

matthew_dunlap
Posts: 3
Joined: 22 Mar 2018, 21:25

26 Mar 2018, 17:16

Thanks for the reply kukeltje. That is more or less what our external contributor has done in their code, which we may use it if that seems to be the only real path. There is still a question of styling the resulting text, but I guess we can apply the correct styles when performing the move.
Primefaces 6.2 / JSF 2.2 / Glassfish 4.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests