gxt中的多选组合框功能

时间:2015-01-14 07:40:17

标签: java gwt gxt

如何实际创建仅包含gxt gwt的多选组合框。 如果这是如何创建组合框的,那么如何创建多选组合框?

idStore = new ListStore<Category>(new ModelKeyProvider<Category>() {

            @Override
            public String getKey(Category item) {
                return item.getIdcategory() + "";
            }
        });
        idStore.addAll(list);

        cmbCat = new ComboBox<Category>(idStore, new LabelProvider<Category>() {

            @Override
            public String getLabel(Category item) {
                return item.getStrName();
            }
        });

        cmbCat.addValueChangeHandler(new ValueChangeHandler<Category>() {

            @Override
            public void onValueChange(ValueChangeEvent<Category> event) {
                catId = event.getValue().getIdcategory();
            }
        });

        cmbCat.setValue(idStore.get(0));
        cmbCat.setAllowBlank(false);
        cmbCat.setForceSelection(true);
        cmbCat.setTypeAhead(true);
        cmbCat.setTriggerAction(ComboBoxCell.TriggerAction.ALL);

0 个答案:

没有答案