So folks, I have a fileUpload component of primefaces to upload files. It turns out that even with required="true", if the user clicks send without having uploaded any files the system sends.
<p:fileUpload
required="true"
requiredMessage="Comprovante ou declaração de vínculo de trabalho: item obrigatório"
fileUploadListener="#{comprovanteBean.uploadArquivoDespesaTransporte}" update="@form"
label="Arquivo" uploadLabel="Enviar" cancelLabel="Cancelar"
allowTypes="/(\.|\/)(gif|jpe?g|png|pdf)$/"
invalidFileMessage="São permitidos apenas arquivos do tipo: jpeg, jpg, png, pdf)"
sizeLimit="1048576"invalidSizeMessage="O tamanho máximo permitido é de 1 MB."
fileLimit="1">
</p:fileUpload>
<p:commandButton value="Enviar comprovantes" update="@form" ajax="false" action="#{comprovanteBean.finalizarInscricao()}">
<f:param name="inscricaoFinalizada" value="true"/>
</p:commandButton>
On the firstfaces site, their button is locked, but it does not activate when I upload it, and you can not even get their code: link
Does anyone have any idea how to not allow the user to sign up without sending this file ??