gaffcz
gaffcz

Reputation: 3479

datatable: automatical refresh after a specified time

Could you recommend me some easy way to automatically refresh of dataTable each e.g. 10 minutes?

<rich:dataTable id="table" var="item" value="#{bean.model}">    
  <rich:columnGroup>
    <rich:column><h:outputText value="#{item.id}"/></rich:column>
    <rich:column><h:outputText value="#{item.name}"/></rich:column>
    ...
  </rich:columnGroup>

  <f:facet name="footer">  
    <h:commandButton id="load" action="#{bean.loadData}"/>
  </f:facet>    
</rich:dataTable>

I've tried a few ways but it always had a catch, so I'm looking for some common method..

Upvotes: 0

Views: 2527

Answers (1)

Ben
Ben

Reputation: 10288

Try Richfaces a4j:poll (link)

<h:form>
    <a4j:poll id="poll" interval="600000" reRender="table"/>
</h:form>

Upvotes: 1

Related Questions