title: primefaces fileupload required attribute not working
body: <p>I have a JSF form which contains a Primefaces fileupload component.</p>
  
  <p>The required attribute of the fileupload component is not working; When I hit the form's send button without file attachments, the form is sent and no error message is displayed. </p>
  
  <p>This is the simplified form code I am using for testing: </p>
  
  <pre><code>&lt;h:form id="NewRegistryForm"&gt;
    &lt;fieldset&gt;
      &lt;p:outputLabel for="address" value="Address" /&gt;
      &lt;h:inputText 
          name="address" 
          value="#{registryBean.address}" 
          required="true" 
          requiredMessage="Address field is required" /&gt;
    &lt;/fieldset&gt;
    &lt;fieldset&gt;
      &lt;p&gt;File attachments:&lt;/p&gt;
      &lt;p:fileUpload 
        fileUploadListener="#{registryBean.handleFileUpload}" 
        mode="advanced" 
        label="Choose file"
        multiple="true" 
        update="registryFileList"
        invalidFileMessage="Invalid file type"
        sizeLimit="512000" 
        fileLimit="15" 
        allowTypes="/(\.|\/)(jpg|png|gif|pdf|odt|doc|docx)$/i" 
        onstart="setSubmitButtonEnabled(false)" 
        oncomplete="setSubmitButtonEnabled(true)" 
        onerror="setSubmitButtonEnabled(true)" 
        auto="true" 
        required="true"
        requiredMessage="A file attachment is required." /&gt;
    &lt;/fieldset&gt;
    &lt;p:dataList id="registryFileList" value="#{registryBean.uploadedFiles}" 
    var="file" emptyMessage="" &gt;#{file.file.fileName}, #{file.file.size}&lt;/p:dataList&gt;
    &lt;p:commandButton 
      type="submit" 
      action="#{registryBean.sendRequest}" 
      value="Send form" 
      validateClient="true" /&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>The required text input field shows an error message when the field is not filled, but the fileupload component produces no message when no file is attached. What am I doing wrong?</p>