我想随着服务器中数据的变化动态更新数据表列(特定列),它必须通过 ajax 调用反射(reflect)在 UI 中。我怎样才能用 primeface 实现这一目标。
最佳答案
您可以使用 primefaces 提供的轮询机制 p:poll标签。
来自 Primefaces 文档:
Poll is an ajax component that has the ability to send periodical ajax requests and execute listeners on JSF backing beans
<h:form id="form">
<p:dataTable id="tab" ...>
//cols
</p:dataTable>
<p:poll interval="3"
listener="#{counterBean.increment}" update="tab" />
</h:form>
关于ajax - Primefaces数据表动态更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14196132/