Filtering in datatable with ajax is not working

UI Components for JSF
Post Reply
mustufa
Posts: 31
Joined: 06 Mar 2010, 06:49
Location: India
Contact:

06 Mar 2010, 07:03

Hello every one,

I am pretty new to jsf and primefaces I am using data table with ajax but the serach is not working in it.
The search works fine without ajax, so please can anyone suggest me what the problem can be with ajax filtering.

Code: Select all

<f:view>
            <h:form>
                <!--<p:dataTable var="a" value="#{student.getStudents()}" paginator="true" rows="10" lazy="true" id="tbl" emptyMessage="Sorry there are no data available" loadingMessage="Please Wait">-->
                <p:dataTable dynamic="true" var="a" value="#{tablebean.lazyModel}"  paginator="true" rows="10" lazy="true" id="tbl" emptyMessage="Sorry there are no data available" loadingMessage="Please Wait">
                    <p:column filterBy="#{a.model}">
                        <f:facet id="model" name="header">
                            <h:outputText value="Model" />
                        </f:facet>
                        <h:outputText value="#{a.model}" />
                    </p:column>

                    <p:column filterBy="#{a.year}">
                        <f:facet name="header" >
                            <h:outputText value="Year" />
                        </f:facet>
                        <h:outputText value="#{a.year}" />
                    </p:column>

                    <p:column filterBy="#{a.manufacturer}">
                        <f:facet name="header">
                            <h:outputText value="Manufacturer" />
                        </f:facet>
                        <h:outputText value="#{a.manufacturer}" />
                    </p:column>

                    <p:column filterBy="#{a.color}">
                        <f:facet name="header">
                            <h:outputText value="Color" />
                        </f:facet>
                        <h:outputText value="#{a.color}" />
                    </p:column>
                </p:dataTable>

                <h:panelGrid columns="2">
                    <p:panel header="Export All Data">
                        <h:commandLink>
                            <p:graphicImage value="images/excel.png" />
                            <p:dataExporter type="xls" target="tbl" fileName="cars" />
                        </h:commandLink>

                        <h:commandLink>
                            <p:graphicImage value="images/pdf.png" />
                            <p:dataExporter type="pdf" target="tbl" fileName="cars"/>
                        </h:commandLink>

                        <h:commandLink>
                            <p:graphicImage value="images/csv.png" />
                            <p:dataExporter type="csv" target="tbl" fileName="cars" />
                        </h:commandLink>

                        <h:commandLink>
                            <p:graphicImage value="images/xml.png" />
                            <p:dataExporter type="xml" target="tbl" fileName="cars" />
                        </h:commandLink>
                    </p:panel>

                    <p:panel header="Export Page Data">
                        <h:commandLink>
                            <p:graphicImage value="images/excel.png" />
                            <p:dataExporter type="xls" target="tbl" fileName="cars" pageOnly="true"/>
                        </h:commandLink>

                        <h:commandLink>
                            <p:graphicImage value="images/pdf.png" />
                            <p:dataExporter type="pdf" target="tbl" fileName="cars" pageOnly="true"/>
                        </h:commandLink>

                        <h:commandLink>
                            <p:graphicImage value="images/csv.png" />
                            <p:dataExporter type="csv" target="tbl" fileName="cars" pageOnly="true"/>
                        </h:commandLink>

                        <h:commandLink>
                            <p:graphicImage value="images/xml.png" />
                            <p:dataExporter type="xml" target="tbl" fileName="cars" pageOnly="true"/>
                        </h:commandLink>
                    </p:panel>
                </h:panelGrid>
            </h:form>
        </f:view>

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

06 Mar 2010, 16:52

PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Mar 2010, 14:57

What is the PrimeFaces version you have and more info about your environment please?

Why noone reads the forum posting guidelines :)

mustufa
Posts: 31
Joined: 06 Mar 2010, 06:49
Location: India
Contact:

08 Mar 2010, 08:18

Hello cagatay.civici

I am using net beans 6.8 and primefaces jar 2.0 i also have two another jar files
1) iText 1.4.8
2) poi 3.2 final.jar

and also one more thing i cannot access progress bar which is the new component in primefaces 2.0

it shows the error that component library null dosen't contains such component.

Thanks

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

08 Mar 2010, 16:48

Ajax filtering is a known issue that happens in PrimeFaces 2 only, it works with PrimeFaces 1. So we need to find out and fix the problem on that. You can star the issue Oleg posted to get notifications.

ProgressBar is added after 2.0 release so you need a nightly build of 2.0.1-SNAPSHOT.

mustufa
Posts: 31
Joined: 06 Mar 2010, 06:49
Location: India
Contact:

09 Mar 2010, 12:31

Thanks cagatay.civici for your feed back that you gave me,
your support is appreciated. And please can you advise me from where to get nightly build of 2.0.1-SNAPSHOT so that i can work with progress bar.

Thanks
Mustufa


mustufa
Posts: 31
Joined: 06 Mar 2010, 06:49
Location: India
Contact:

09 Mar 2010, 14:45

Thanks cagatay :D now i get the progress bar option in my project.

But have one problem integrating it. The progress bar comes up on the web page but the start and stop link does not work i did check the page source but i am not getting the functions pbAjax.start() and pbAjax.cancel().

Thanks
Mustufa

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

09 Mar 2010, 14:54

start and stop are the client side api, you need to apply them with your own widgetVar. pbAjax is just an example.

Also please create a new post for progressbar related questions as this post is about filtering in datatable.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 48 guests