How to refresh a single row in a table?

删除回忆录丶 提交于 2019-12-10 13:36:24

问题


Is it possible to refresh a single row of a vaadin table component?

So far, if table row editing is finished, I'm just refreshing the whole table:

table.refreshRowCache();

But that will probably cause performance issues later for large tables. So, how could a single row be refreshed?


回答1:


I found this on the Vaadin forum which seems useful: https://vaadin.com/forum/#!/thread/408555/408554

I haven't yet given it a go but, Henri Sara (Vaadin developer) suggested this solution:

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

He also notes that this method may change in a future version (and may have done so already :S)




回答2:


1.update your beanItemContainer

2.table.refreshRowCache();

Example:

beanItemContainer.getItem(itemId).getItemProperty("quantity").setValue(productEditor.getProduct().getQuantity());
table.refreshRowCache();


来源:https://stackoverflow.com/questions/19077760/how-to-refresh-a-single-row-in-a-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!