2 Replies Latest reply on Oct 13, 2007 12:10 PM by Selcuk Bozdag

    s:fileupload validation

    Selcuk Bozdag Newbie

      Hi,

      I am trying to make sure that user specified a file to upload. @NotNull did not worked. I have then read something on SeamProblemsFAQ (http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamProblemsFAQ) about a @NotNull issue.

      I am now using required attribute for s:fileupload . But it did not worked for me..

       <h:form id="fileUploader" enctype="multipart/form-data">
       <h:panelGrid columns="2">
       <h:outputLabel for="file">File:</h:outputLabel>
       <s:fileUpload id="file" data="#{fileUploader.resultsFile}"
       contentType="#{fileUploader.contentType}"
       required="true"
       requiredMessage="You must specify a file"/>
       </h:panelGrid>
      
       <!-- Buttons and other stuff -->
       ...
       </h:form>
      


      Thank you