我在我的項目中使用Vaadin ComboBox,現在我遇到了一個新問題,它不允許我在單擊組合框或單擊組合框後打開組合列表DropDown圖標! 我可以鍵入ComboBox並使用鍵盤上的箭頭鍵打開ComboBox列表,但不能單擊。 我發現,當我把鼠標指針放在ComboBox的特定區域頂部時,指針會變成一個Hand,然後我可以點擊打開列表,但在這種情況下,它發生的事情很少,我可以集中鼠標指針,就像整個ComboBox上的一個小點。Vaadin ComboBox不允許我點擊
,我使用這個組合框的唯一代碼,編輯:
public class ChildElement extends OgsAbstractForm<Child> {
@Inject
ChildFacade childFacade;
ComboBox cbChild=new ComboBox();
HorizontalLayout mainLayout=new MHorizontalLayout();
@Override
protected Component createContent() {
List<Child> children=new ArrayList<Child>();
children.addAll(childFacade.findAll());
for(int i=0;i<children.size();i++){
cbChild.addItem(children.get(i).getName());
}
cbChild.select(children.get(0).getName());
cbChild.setFilteringMode(FilteringMode.CONTAINS);
mainLayout.addComponent(cbChild);
return mainLayout;
}
}
然後我像下方查看使用該元素,
public class OGSVertragView extends CssLayout implements View{
@Inject
ChildElement childElement;
VerticalLayout main=new VerticalLayout();
@PostConstruct
void init() {
main.addComponent(childElement);
addComponents(main);
}
}
這將是非常很好,當有人能以某種方式給我一個線索或幫助我。
最好的問候!
什麼是'cbKinder'? – Shirkam
對不起,我將元素名稱從德文更改爲英文,並忘記了一個:D @Shirkam –
您正在使用哪個版本的Vaadin? – Shirkam