如何仅更新jsf数据表列

如何仅更新jsf数据表列,jsf,datatable,jboss6.x,Jsf,Datatable,Jboss6.x,我在数据表的列中有一个计数器。一旦计数器达到某个时间,我只需要更改该列的背景色。正在从数据库中提取表的数据。我使用a4j:poll来重新命名列,但问题是整个表都被渲染了。下面是一些代码: <a4j:region> <h:form> <a4j:poll id="poll" interval="1000" enabled="true" reRender="blink" limitToList="true" />

我在数据表的列中有一个计数器。一旦计数器达到某个时间,我只需要更改该列的背景色。正在从数据库中提取表的数据。我使用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>

如果您满足以下最低要求“JSF 2.0、EL 2.1和Servlet 2.5

您可以尝试,这里有一个关于如何在showcase中使用它的示例

注意,Ajax#updateRow()和Ajax#updateColumn()只能进行更新 单元格内容(当它已包装在某个容器组件中时) 固定身份证


也许您可以使用推送服务器端事件来触发客户端的更新,而不是使用执行完整表单的轮询


完整说明如何使用此选项:

您应该按列id重新渲染,但由于您有来自数据库的数据,并且它是一个列表,您能否确认您可以执行什么操作?调用哪个real可以更新一列?

谢谢Daniel。Daniel,我能够使用Omnifaces实现一个解决方案。谢谢您的建议。PushEventListener已不存在,因此我无法尝试此解决方案。抱歉,我无法理解您的问题。尽管如此,我还是找到了使用OmniFaces组件的解决方案。