Java 带默认选项的Vaadin可编辑组合框
我是新的Vaadin开发者,我有一个小问题,希望能在这里解决 实际上,我有一个组合框,其中包含一些数据和一个过滤器,可以找到一些匹配项,所以。。。我需要在组合框中输入用户需要的新值。问题是我不能输入新值,因为当我输入新值时,我的过滤器会删除我的新提案 我的代码Java 带默认选项的Vaadin可编辑组合框,java,javascript,html,vaadin,Java,Javascript,Html,Vaadin,我是新的Vaadin开发者,我有一个小问题,希望能在这里解决 实际上,我有一个组合框,其中包含一些数据和一个过滤器,可以找到一些匹配项,所以。。。我需要在组合框中输入用户需要的新值。问题是我不能输入新值,因为当我输入新值时,我的过滤器会删除我的新提案 我的代码 //Select select_editable = new Select(); ComboBox cbEducation = new ComboBox(); cbEducation.setTextInputAll
//Select select_editable = new Select();
ComboBox cbEducation = new ComboBox();
cbEducation.setTextInputAllowed(true);
cbEducation.setNewItemsAllowed(true);
cbEducation.setFilteringMode(AbstractSelect.Filtering.FILTERINGMODE_CONTAINS);
//Fill the component with some items.
for (int i = 0; i < planets.length; i++)
for (int j = 0; j < planets.length; j++) {
cbEducation.addItem(planets[j] + " to " + planets[i]);
}
//select_editable.
mainLayout.addComponent(cbEducation, 1, 0);
mainLayout.setComponentAlignment(cbEducation, new Alignment(33));
//Select_editable=new Select();
ComboBox cbEducation=新建ComboBox();
cbEducation.setTextInputAllowed(true);
cbEducation.setNewItemsAllowed(true);
cbEducation.setFilteringMode(AbstractSelect.FILTERINGMODE.FILTERINGMODE_包含);
//用一些项目填充组件。
for(int i=0;i
我希望有人能帮助我。。。无论如何,谢谢你的阅读
提前谢谢 如果您想在输入新输入的值后立即看到它们,则必须将组合框立即模式设置为true
cbEducation.setImmediate(true);
如果使用VisualDesigner创建布局,请小心。它将所有组件立即状态设置为false。希望这个不错的工具能很快得到更新。默认情况下,Vaadin 7.2+中的ComboBox是即时的。完全完成。我不知道我为什么不试试这个,非常感谢!默认情况下,许多组件是直接的。但是如果您使用可视化设计器创建布局。它将立即设置为false。看起来视觉设计师有点过时了。