Primefaces DataTable not showing result of globalfilter

Fitnerd Source

i am trying to use the globalfilter from Showcase primefaces datatable filter. I have the problem that my datatable is not updating or showing any results of the filter.

index.html

<div id="content">
    <h:form id="form">
        <p:dataTable var="prod" value="#{ProductHandler.products}"
            widgetVar="productsTable"
            emptyMessage="Keine Produkte gefunden die der Suche entsprechen"
            filteredValue="#{ProductHandler.filtered}">

            <f:facet name="header">
                <p:outputPanel>
                    <h:outputText value="Suche:" />
                    <p:inputText id="globalFilter"
                        onkeyup="PF('productsTable.filter()" style="width:300px"
                        placeholder="Wo nach suchen Sie?" />
                </p:outputPanel>
            </f:facet>

            <p:column headerText="Produkt" filteredBy="prod.name"
                filterMatchMode="contains">
                <h:outputText value="#{prod.name}" />
            </p:column>
            <p:column headerText="Preis" filterBy="prod.price"
                filterMatchMode="contains">
                <h:outputText value="#{prod.price}" />
            </p:column>
            <p:column headerText="Kategorie" filteredBy="prod.kategorie"
                filterMatchMode="contains">
                <h:outputText value="#{prod.kategorie}" />
            </p:column>
            <p:column headerText="Geschlecht" filteredBy="prod.geschlecht"
                filterMatchMode="contains">
                <h:outputText value="#{prod.geschlecht}" />
            </p:column>
        </p:dataTable>
    </h:form>

    <div class="push"></div>
</div>

I have a ProductHandler bean with 2 DataModelLists and a Product.java with price, name, etc.. I created everthing like shown in the example. Maybe some tips?

I am thankful for every help! :)

jsfprimefacesjsf-2

Answers

comments powered by Disqus