【问题标题】:PrimeFaces fileUpload not working with dropZonePrimeFaces fileUpload 不适用于 dropZone
【发布时间】:2021-10-11 17:28:29
【问题描述】:

我无法上传拖动到注册为 dropZone 的 inputTextarea 组件上的文件。这是我的代码,基于 PrimeFaces 演示示例 - 我错过了什么吗?当文件被拖到 fileUpload 组件本身时,文件就会上传。

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:p="http://primefaces.org/ui">

<h:head></h:head>

<h:body>
    <h:form enctype="multipart/form-data">
    
        <p:inputTextarea id="customDropZone" />
    
        <p:fileUpload
            dropZone="customDropZone"
            widgetVar="docUploader"
            listener="#{test.uploadDocument}"
            sizeLimit="100000"
            allowTypes="/(\.|\/)txt$/"
        />
    
    </h:form>
</h:body>
</html>

设置为 Glassfish 6.2 / Primefaces 10 / Mojarra 3.0.1。

【问题讨论】:

    标签: file-upload primefaces dropzone


    【解决方案1】:

    dropZone 属性已添加到 PrimeFaces 11(因此,它在 10 中不可用)。请注意,当前展示展示的是 PrimeFaces 11.0.0-RC1。因此,如果您想使用此功能,请升级。

    另见:

    【讨论】:

      猜你喜欢
      • 2017-11-30
      • 2013-12-17
      • 2023-03-10
      • 2021-03-23
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      • 2021-10-12
      • 1970-01-01
      相关资源
      最近更新 更多