【问题标题】:Vaadin 8 Combobox howto selected fist itemVaadin 8 Combobox 如何选择拳头项目
【发布时间】:2019-06-04 12:41:32
【问题描述】:

我尝试了以下方法:

 machineComboBox.setEmptySelectionAllowed(false);
 machineComboBox.focus();
 this.addComponent(machineComboBox);

我读到了:

Cannot set focus on combobox inside a grid

【问题讨论】:

    标签: combobox vaadin vaadin8


    【解决方案1】:

    您到底想达到什么目的?如果您只是想选择第一项,那么这应该可以:

    machineComboBox.setSelectedItem(yourItems.get(0));
    

    示例取自这里:Selection Components

    focus() 不选择任何内容,只关注(概述)组件​​。

    【讨论】:

    • 是的作品:machineComboBox.setSelectedItem(itemsCollect.get(0))
    猜你喜欢
    • 2023-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-08
    • 2019-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多