如何刷新表中的单行? [英] How to refresh a single row in a table?

查看:32
本文介绍了如何刷新表中的单行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

推荐答案

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

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

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

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();
}

他还指出此方法可能会在未来版本中更改(并且可能已经这样做了:S)

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

这篇关于如何刷新表中的单行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆