title: Primefaces isn't working in mode advance jsf 2.0
body: <p>I'm trying to upload file using primefaces 4.0 in jsf 2.0.
  After I config pom.xml and web.xml and it can work with mode="simple" and I can choose a file well.
  My problem is upload multiple file in mode="advance", it display a upload panel in UI but javascript not  working.
  I don't add any js lib in my jsf page to escape conflict with primefaces js.<br>
  Do you have any recommend related?</p>
  
  <p>In the case I can't use primefaces with mode="advance" then what should i use to upload multiple file in jsf 2.0?</p>
  
  <p>Please help.
   - XHTML:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
        &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"&gt;
  
  &lt;h:head&gt;
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h:form enctype="multipart/form-data"&gt;
          &lt;p:fileUpload fileUploadListener="#{helloBean.upload}"
              mode="advanced" dragDropSupport="false" multiple="true"
              sizeLimit="100000" fileLimit="3"
              allowTypes="/(\.|\/)(gif|jpe?g|png)$/" /&gt;
      &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <ul>
  <li><p>ManageBean</p>
  
  <pre><code>@ManagedBean
  @SessionScoped
  public class HelloBean implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      private String destination = "E:\\uploadFile\\";
  
      private UploadedFile file;
  
      public void upload(FileUploadEvent event) {
          System.out.println(event.getFile().getFileName() + " is uploaded.");
      }
  
      public UploadedFile getFile() {
          return file;
      }
  
      public void setFile(UploadedFile file) {
          this.file = file;
      }
  
  }
  </code></pre></li>
  <li><p>web.xml     </p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.faces&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;!-- ############################################# --&gt;
  &lt;!-- # File upload                               # --&gt;
  &lt;!-- ############################################# --&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
      &lt;filter-class&gt;
          org.primefaces.webapp.filter.FileUploadFilter
      &lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;PrimeFaces FileUpload Filter&lt;/filter-name&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
  &lt;/filter-mapping&gt;
  </code></pre></li>
  <li><p>pom.xml:</p>
  
  <p></p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
          &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
          &lt;version&gt;4.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;commons-io&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
          &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
          &lt;version&gt;2.1.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-impl&lt;/artifactId&gt;
          &lt;version&gt;2.1.7&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
          &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
          &lt;version&gt;2.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.el&lt;/groupId&gt;
          &lt;artifactId&gt;el-ri&lt;/artifactId&gt;
          &lt;version&gt;1.0&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;finalName&gt;JavaServerFaces&lt;/finalName&gt;
  
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.6&lt;/source&gt;
                  &lt;target&gt;1.6&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre></li>
  <li><p>library: i add commons-fileupload-1.2.jar, commons-fileupload-1.2-sources.jar, commons-io-2.4.jar,
  commons-io-2.4-sources.jar, primefaces-4.0.jar, primefaces-4.0-sources.jar.</p></li>
  <li><p>Error show from firebug:</p>
  
  <pre><code>TypeError: $(...).addclass is not a function
  $(this).addclass('ui-state-focus');
  </code></pre>
  
  <p>The error happen below file.<br>
  <strong>http:/.../JavaServerFaces/javax.faces.resource/fileupload/fileupload.js.xhtml?ln=primefaces&amp;v=4.0</strong></p></li>
  </ul>
  
  <p>I already upload with mode="simple" successful but not success with mode="advance".
  What's i missing?</p>