Saving global filter primefaces when using poll

Posted: November 12, 2012 in web

Had this working using filter event on p ajax. See complete code below.


	<h:panelGroup id="main">
		<p:dataTable id="reportTable" var="car" value="#{}" widgetVar="reportTable">
			<f:facet name="header">  
                <p:inputText id="globalFilter" styleClass="globalFilter" value="#{cars.filterGlobal}" onkeyup="reportTable.filter()" />
                <p:watermark for="globalFilter" value="Search with a keyword" />
			<p:column filterBy="#{}"
				headerText="Name" filterMatchMode="startsWith">
				<h:outputText value="#{}" />

			<p:ajax  oncomplete="reportTable.filter();" event="filter" 
				update=":main"  />

	<p:poll interval="30" update=":main" />


public class Bean implements Serializable {

    private static final long serialVersionUID = -6519881882062309049L;

    private String filterGlobal;

    public String getReportFilterGlobal() {
        return reportFilterGlobal;

    public void setReportFilterGlobal(String reportFilterGlobal) {
        this.reportFilterGlobal = reportFilterGlobal;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s