Uczę się JSF i napotkałem na błąd w mojej aplikacji. Mam tabelę, z której chcę usuwać rekordy. Funkcja ta działa, jednak żeby zobaczyć efekt muszę odświeżyć stronę. Co zrobić aby strona odświeżała się automatycznie?
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form id="form">
<p:dataTable value="#{customerBean.customers}" var="customer" editable="true">
<p:column headerText="Id">
<h:outputText value="#{customer.id}"/>
</p:column>
<p:column headerText="Imie">
<h:outputText value="#{customer.firstName}"/>
</p:column>
<p:column headerText="Nazwiko">
<h:outputText value="#{customer.lastName}"/>
</p:column>
<p:column headerText="tel">
<h:outputText value="#{customer.phoneNumber}"/>
</p:column>
<p:column headerText="data">
<h:outputText value="#{customer.date}"/>
</p:column>
<p:column headerText="komentarz">
<h:outputText value="#{customer.comment}"/>
</p:column>
<p:column headerText="del">
<p:selectBooleanCheckbox value="#{customer.selected}"/>
</p:column>
</p:dataTable>
<p:commandButton value="delete" actionListener="#{customerBean.delete()}" update="form" />
</h:form>
</h:body>
</html>