AutoUpdate is a utility tag, which registers the attached/parent component to be updated automatically on each ajax request.
All ajaxified components (includes p:ajax) provides an attribute, to mark the current request to ignore all autoUpdates.
<h:form>
<p:outputPanel>
<p:autoUpdate />
Time: #{autoUpdateView.time}
</p:outputPanel>
<p:commandButton value="AJAX request" update="@none" process="@this" />
<p:commandButton value="AJAX request with ignoreAutoUpdate=true" update="@none" process="@this" ignoreAutoUpdate="true" />
</h:form>@Named
@RequestScoped
public class AutoUpdateView {
private String time;
@PostConstruct
public void init() {
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date now = new Date();
time = sdfDate.format(now);
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}