【发布时间】:2014-11-24 15:11:15
【问题描述】:
我在数据表的列中有一个计数器。一旦计数器达到某个时间,我只需要更改该列的背景颜色。正在从数据库中提取表的数据。我正在使用 a4j:poll 重新渲染列,但问题是渲染了整个表。下面是一些代码:
<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>
【问题讨论】: