PrimeFaces 在表单内使用 FileDownload
我在我的项目中使用 PrimeFaces 作为网络技术。我有一个注册表,用户可以通过该注册表自行注册。在该形式中,用户还可以附加一些文档。目前为止没有问题。但是,当用户填写表格并附加一些文件时,用户可以通过下载来检查附件。为了提供文件下载,我使用了 fileDownload 和 commandButton。 它工作正常,但问题是当用户想要下载附件时,表单会被验证!因此,如果表单中的任何字段未经验证,用户将无法下载任何文件! 我想为用户提供机会,以便他可以在填写表单字段之前先附加文档并检查它们。 如果有人能帮助我,我将非常感激。
I'm using PrimeFaces as the web technology in my project. I have a registration form, by that the user registers himself. In that form, the user can also attach some documents. There is no problem so far. But when the user filled the form and attached some documents, the user can check the attachment by downloading them. To provide downloading the files, I used fileDownload with commandButton.
It works fine, but the problem is that when the use wants to download the attached files, the form is validated! So if any field in the form is not validated, the user can't download any file!
I want to provide the opportunity for the user, so that he can first attach the document and check them before filling the form's fields.
I'm very appreciated it if anybody can help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用作
命令按钮的属性,在其中使用文件下载。
有关即时的更多信息请查看此处。
use
as the attribute for the commandButton, inside that you are using fileDownload.
For more information about immediate look here.