【问题标题】:File upload with advanced mode not working使用高级模式上传文件不起作用
【发布时间】:2014-10-06 14:59:10
【问题描述】:

我正在尝试在 Appfuse 项目中添加 FileUpload 的高级模式,我点击了这个链接:http://www.primefaces.org/showcase/ui/file/upload/multiple.xhtml

我添加了它,但是在选择我的文件时,咆哮标签中没有显示任何文件,并且上传和取消按钮钢禁用。

在我的导航器的终端我有这个错误:TypeError: undefined is not a function。

你能帮我吗? 谢谢

【问题讨论】:

  • 页面中有 h:head 吗?无需任何代码即可猜测
  • 你更新 web.xml 了吗?
  • 我在 tje 页面中添加了 h:head,但钢不起作用。 @Mathew:我必须在 web.xml 中进行哪些更新?
  • 当我将 classpath:META-INF/resources/webjars/jquery/1.9.0/jquery.min.js 更改为 classpath:META- 时,它现在可以工作了wro.xml 中的 INF/resources/webjars/jquery/1.12.0/jquery.min.js 但是当我单击上传文件时,没有调用方法 fileUploadListener="#{fileUpload.handleFileUpload}" 否事情发生。 @JaqenH'ghar

标签: jsf file-upload primefaces appfuse


【解决方案1】:

展示有一个错误 你需要用值 multipart/form-data 声明 enctype 示例

<h:form enctype="multipart/form-data">
    <p:growl id="messages" showDetail="true" />
 <p:fileUpload fileUploadListener="#{fileUploadView.handleFileUpload}" mode="advanced" dragDropSupport="false"
                  multiple="true" update="messages" sizeLimit="100000" fileLimit="3" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />

    <p:growl id="messages" showDetail="true" />
</h:form>

【讨论】:

    猜你喜欢
    • 2015-08-05
    • 2015-08-28
    • 2016-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-27
    • 2013-03-04
    • 2013-08-05
    相关资源
    最近更新 更多