0

I have several (5) primefaces steps. All of my form items validate pretty well, but my primefaces file uploader is not validated:

                    <p:fileUpload
                            fileUploadListener="#{cc.attrs.bean.handler}"
                            mode="simple"
                            immediate="true"
                            required="true" requiredMessage="#{i18n.requiredUploaderMessage}" auto="true"
                            label="#{i18n.UploadMessageDefault}" skinSimple="true"
                            id="file-termo-adesao" sizeLimit="2000000" fileLimit="1"
                            allowTypes="/(\.|\/)(pdf|doc|docx|odt)$/">
                    </p:fileUpload>


Is it possible to validate file uploader inside steps, like the other form elements?

plr108
  • 1,201
  • 11
  • 16
davidwillianx
  • 391
  • 2
  • 5
  • 13
  • I think it is because file upload uses its own AJAX calls outside of normal PF calls when its doing its uploads etc. So its not running through normal validations. If I remember there are some JS tricks you can do if you search around. – Melloware Apr 07 '20 at 18:51
  • What kind of validation do you need? Which Pf version are you using? Do you have others fileUpload in the same form? – WoAiNii Apr 07 '20 at 19:22
  • @Melloware I'm trying to figure out how can I fix this – davidwillianx Apr 07 '20 at 19:33
  • @MatteoZanini Primefaces 6.2 / Just one fileUploader – davidwillianx Apr 07 '20 at 19:33

0 Answers0