1
如何以编程方式选择插入的表格行?该表绑定到BeanContainer
,每次单击添加按钮时,我想要插入一行并使其不带ItemClick可选。如何在表中以编程方式选择插入的行?
我看过SQLContainer
here的另一个例子,但它不适用于我。
下面是按钮,成功地插入该行的听众:
addButton.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
Object itemId = addList();
table.addItem(itemId);
table.getItem(itemId).getItemProperty("PS_SECTION").setValue(n);
table.setValue(itemId);
table.select(itemId);
table.commit();
}
});
你有没有试图把'table.commit'之后的'table.select(itemId)'? –
@defaultlocale我现在试过了,它没有工作。你有任何其他想法尝试? – natso
抱歉,不知道,我没有准备好环境。我会尝试手动选择一个项目,检查'table.getValue()'返回什么,然后尝试模拟它。另外,尝试在提交后放置'setValue'。 –