我在數據表的列中有一個計數器。一旦計數器達到特定時間,我只需要更改該列的背景顏色。該表的數據正在從數據庫中提取。我正在使用a4j:poll重新調用列,但問題是整個表格都被渲染。下面的一些代碼:如何更新jsf數據表只有
<a4j:region>
<h:form>
<a4j:poll id="poll" interval="1000" enabled="true" reRender="blink" limitToList="true" />
</h:form>
</a4j:region>
<h:form id="form1">
<a4j:outputPanel id="panel1" ajaxRendered="true">
<h:dataTable id="blinks" styleClass="tableClass" value="#{bean.list}" var="_item">
<h:column id="blink">
<f:facet name="header">
<h:outputText value="Header1" />
</f:facet>
<div id="div1" class="#{bean.check() ? 'red' :''}">
<h:outputText value="Counter text (counts seconds)" />
</h:column>
</h:dataTable>
</a4j:outputPanel>
</h:form>
謝謝丹尼爾。之後我會嘗試更新。 – user3389171 2014-11-24 15:41:35
丹尼爾,我能夠使用Omnifaces實現解決方案。謝謝你的建議。 – user3389171 2014-12-03 20:15:43