【问题标题】:Vaadin How to arrange redirection through the tabs in tabsheet?Vaadin 如何通过选项卡中的选项卡安排重定向?
【发布时间】:2016-11-23 13:29:27
【问题描述】:

有谁知道如何解决我的问题。 我有一个带有 4 个标签的 TabSheet。我需要在上传文件时将用户重定向到第二个选项卡。我的代码:

   //create tabsheet with 4 tabs    
private void createTabs() {
TabSheet tabs = new TabSheet();
FirstTab firstTab = new FirstTab();
tabs.addTab(firstTab, "FirstTab");
SecondTab secondTab = new SecondTab();
tabs.addTab(secondTab, "SecondTab");
ThirdTab thirdTab = new ThirdTab();
tabs.addTab(thirdTab, "ThirdTab");
FourthTab fourthTab = new FourthTab();
tabs.addTab(fourthTab, "FourthTab");    
vertLayout.addComponent(tabs);
}

//create upload button
    private Button uploadButton() { 
    Button uploadFile = new Button("Upload");
    UI.getCurrent().addWindow(new UploadFileWindow());
    return uploadFile;    
      }  

感谢支持!

【问题讨论】:

  • 谢谢!确实,这是个好主意

标签: java tabs vaadin


【解决方案1】:

Vaadin TabSheet 组件有一个方法来设置选定的选项卡。

在您的代码中(上传完成后)只需添加:

tabs.setSelectedTab(fourthTab);

Here is the corresponding documentation.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-15
    • 2015-05-19
    • 2015-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多