-1
The script works partially, it updates the page after 5 sec., however it does not perform the click on the button:
<script>
$(document).ready(function() {
setInterval(function() {
cache_clear()
}, 5000);
});
function cache_clear() {
document.getElementById('listTab:teste').click();
window.location.reload(true);
}
My form (.xhtml):
<h:form id="listTab">
<p:panelGrid>
<p:commandButton value="Atualizar Tabela" class="btn btn-block btn-success" ajax="false" actionListener="#{chamadoBean.teste()}" id="teste"/>
</p:panelGrid>
</h:form>
My Bean:
public void teste() {
System.out.println("teste");
}
It shows nothing on the console after the page refreshes, so the button is not clicked. Some other way to do this?