是否可以刷新vaadin table
组件的单行?
到目前为止,如果表格行编辑完成,我只是刷新整个表格:
table.refreshRowCache();
但这可能会在以后导致大型表出现性能问题。那么,如何刷新单行呢?
我在 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)
1.更新你的beanItemContainer
2.table.refreshRowCache();
例子:
beanItemContainer.getItem(itemId).getItemProperty("quantity").setValue(productEditor.getProduct().getQuantity());
table.refreshRowCache();