6

是否可以刷新vaadin table组件的单行?

到目前为止,如果表格行编辑完成,我只是刷新整个表格:

table.refreshRowCache();

但这可能会在以后导致大型表出现性能问题。那么,如何刷新单行呢?

4

2 回答 2

3

我在 Vaadin 论坛上发现这似乎很有用:https ://vaadin.com/forum/#!/thread/408555/408554

我还没有尝试过,但是 Henri Sara(Vaadin 开发人员)建议了这个解决方案:

Property statusProperty = pqTable.getContainerProperty(itemId, "statusString");
if (property instanceof MethodProperty) {
    ((MethodProperty) statusProperty).fireValueChange();
}

他还指出,这种方法可能会在未来的版本中发生变化(并且可能已经这样做了:S)

于 2014-03-13T03:26:33.313 回答
0

1.更新你的beanItemContainer

2.table.refreshRowCache();

例子:

beanItemContainer.getItem(itemId).getItemProperty("quantity").setValue(productEditor.getProduct().getQuantity());
table.refreshRowCache();
于 2016-12-12T05:34:28.280 回答