I'm trying to use a4j:poll
component for ajax reloading a datatable after some time interval. It's working fine, but when the table is automatically reloaded and I use the tools (edit/delete row) in the last column, datatable (all the rows) disappears and I have to load it manually (using h:commandButton
)..
Here's part of my code:
<h:form>
<a4j:poll id="poll" interval="30000" action="#{bean.load}" enabled="#{bean.pollEnabled}" render="list" />
</h:form>
<h:form id="list" ...>
<rich:dataTable id="table" var="item" value="#{bean.model}">
...
A button which is calling the same load method:
<h:commandButton id="btn" action="#{bean.load}" ... />
When I reload it using button, I can use the tools in the last column. Don't you know why?
UPDATE:
- seems that in first case (
a4j:poll
), when using edit/delete, constructor of the bean is called........ - bean is
@ViewScoped