有没有办法将进度栏与vaadin流中的上载组件分开?
我可以看到您可以自定义按钮,并调整是否允许上载组件中的上传下载掉落,但是是否有任何方法可以将进度栏拔出,以便可以在弹出窗口中显示。我之所以问,是因为我拥有的上传组件是horizontallayout
上方grid
的一个按钮之一,并且让进度栏看起来非常糟糕。取而代之的是,我想在弹出窗口或类似的过程中介绍进度。这是可能的,如果是这样,该怎么办。我在API或用户手册中找不到任何内容: https:https:// vaadin。 com/doc/最终/ds/components/upload
我的当前代码是(非常基本的原型):
MultiFileMemoryBuffer multiFileMemoryBuffer = new MultiFileMemoryBuffer();
Upload multiFileUpload = new Upload(multiFileMemoryBuffer);
multiFileUpload.addSucceededListener(event -> {
System.out.println("File uploaded : " + event.getFileName());
});
multiFileUpload.setDropAllowed(false);
multiFileUpload.setUploadButton(new Button("Upload"));
我确实看到了一种称为addprogresslistener()
的方法,但是我假设我可以用来添加它在其他地方,我找不到删除当前进度栏的方法。另一个问题是随附的复选标记,错误消息等。理想情况下,将所有东西放在弹出通知窗口或类似的东西中,这将是很棒的...
I can see that you can customize the button as well as adjust whether an upload drop in the Upload Component is allowed but is there any way to pull out the progress bar so that it can be presented in a popup window. I ask because the upload component I have is one of set of buttons in a HorizontalLayout
above a Grid
and having the progress bar looks pretty terrible. Instead I'd like to present the progress in a popup or something like that. Is this possible and if so how can it be done. I cannot find anything in the API or in the user manual at: https://vaadin.com/docs/latest/ds/components/upload
My current code is (very basic prototype):
MultiFileMemoryBuffer multiFileMemoryBuffer = new MultiFileMemoryBuffer();
Upload multiFileUpload = new Upload(multiFileMemoryBuffer);
multiFileUpload.addSucceededListener(event -> {
System.out.println("File uploaded : " + event.getFileName());
});
multiFileUpload.setDropAllowed(false);
multiFileUpload.setUploadButton(new Button("Upload"));
I do see a method called addProgressListener()
however which I assume I could use to add a progressbar somewhere else however I cannot find a way to remove the current progressbars. The other concern is the checkmarks, the error messages, etc. that come with it. Ideally it would be great to take everything and put it in a popup notification window or something like that...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
包含进度栏,错误消息等的文件列表可以通过针对文件列表影片零件来隐藏,要么以
[part =“ file-list”] {display:none; }
在vaadin-upload.css stylesheet中,或使用vaadin-upload :: part(file-list){display:none; }
来自全局样式表。不幸的是,您必须以某种方式重新创建相应的UI,但是有一个
< vaadin-upload-file>
Web组件您可以为此使用。The file list containing the progress bar, error messages, etc, can be hidden with css by targeting the file-list shadow part, either as
[part="file-list"] { display: none; }
in a vaadin-upload.css stylesheet, or withvaadin-upload::part(file-list) { display: none; }
from a global stylesheet.Unfortunately you'll have to recreate a corresponding UI e.g. in an overlay somehow, but there is a
<vaadin-upload-file>
web component you could utilize for that.