Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在执行长时间操作时关闭Vaadin 8确认对话框_Java_Vaadin8 - Fatal编程技术网

Java 如何在执行长时间操作时关闭Vaadin 8确认对话框

Java 如何在执行长时间操作时关闭Vaadin 8确认对话框,java,vaadin8,Java,Vaadin8,我有Vaadin 8确认码,它执行一项长期任务。我想关闭该对话框并显示一个进度条:- ConfirmDialog.show(UI.getCurrent(), "Dynamic Report warning caption", "More than " +rows+ " rows in this table. It will take long time to generate this report.\nDo you still want to c

我有Vaadin 8确认码,它执行一项长期任务。我想关闭该对话框并显示一个进度条:-

        ConfirmDialog.show(UI.getCurrent(), "Dynamic Report warning caption",
                "More than " +rows+ " rows in this table. It will take long time to generate this report.\nDo you still want to continue? ",
                SalkkuTM.getI18N("PortfolioManagementMenuBar.deleteData.confirmDialog.yes.caption"),
                SalkkuTM.getI18N("PortfolioManagementMenuBar.deleteData.confirmDialog.no.caption"), new ConfirmDialog.Listener() {
                    public void onClose(ConfirmDialog dialog) {
                        ProgressBar bar = new ProgressBar();
                        bar.setIndeterminate(true);
                        if (dialog.isConfirmed()) {
                            layout.addComponent(bar);
                            // this method does a long lasting task.
                            dynamicReportParameterGenerator();
                            bar.setVisible(false);
                        }
                    }
                });


我希望在用户选择“是”后立即关闭此对话框。我想展示一个不确定的进度条。我办不到。怎么做?请告诉我怎么做

这是常见问题,您需要在后台线程中使用并更新进度条。这里有一篇关于它的博客文章和视频

关于这个话题,这里也有很好的讨论

我想展示一个不确定的进度条

这意味着你可以简化一些事情。如果您不想在操作过程中更新进度条,只需将进度条置于UI中的不确定模式,完成后,再次更新UI