我在Vaadin中有一个表,其中有4个生成的列。我希望其中之一是可编辑的。因此,该表具有以下列:
private LazyBeanTable<EmailTemplateMapping> createEmailTemplateConfigurationTable()
{
final LazyBeanTable<EmailTemplateMapping> table = new LazyBeanTable<>();
table.setSelectable(true);
table.setMultiSelect(true);
table.setSizeFull();
table.addGeneratedColumn(I18N.TEMPLATE_NAME.msg(), (source, itemId, columnId) -> itemId.getTemplateName() );
table.addGeneratedColumn(I18N.TEMPLATE_DESCRIPTION.msg(), (source, itemId, columnId) -> itemId.getTemplateDescription());
table.addGeneratedColumn(I18N.LANGUAGE.msg(), (source, itemId, columnId) -> itemId.getTemplateLanguage());
table.addGeneratedColumn(I18N.SYSTEMCONFIG_TAB_EMAIL_DOMAIN_MAPPINGS_ACTIVE.msg(), (source, itemId, columnId) -> formatActive(itemId.isActive()));
return table;
}
并且有一个懒豆表的构造函数,
private final Table table;
private final LazyBeanItemContainer<BEANTYPE> container;
public LazyBeanTable()
{
container = new LazyBeanItemContainer<>((pageable, specification) -> getHandler() == null ? null : getHandler().getItems(pageable, specification), specifications, this::onSizeChanged);
table = new Table();
table.setContainerDataSource(container);
table.addValueChangeListener(event -> fireValueChangeEvent());
table.addItemClickListener(event -> fireItemClickedEvent(container.getBean(event.getItemId()), event.isDoubleClick()));
setCompositionRoot(table);
}
我需要描述栏可编辑。
table.addGeneratedColumn(I18N.TEMPLATE_DESCRIPTION.msg(), (source, itemId, columnId) -> itemId.getTemplateDescription());
我该怎么做。请帮助