Board index JavaServer Faces General Filter a datatable not working... in library 3.5

Filter a datatable not working... in library 3.5

Components, Ajax Framework, Utilities and More.


Posts: 7
hello, implement a data table with filters on the columns in version 3.4.2 primefaces change the library to 3.5 and now I work. Review the sample again and I found that is added filteredValue = "# {tableBean.filteredCars}" is an empty list second example. What should I do to make it work?


Posts: 511
Location: Belgium
Hello,

What is the scope of the tableBean? As stated in the users guide, the scope should be longer then RequestScope.

See Data Filtering on page 135

Regards
Rudy
PrimeFaces version 3.5, Tomcat 7, Mojarra 2.1.13
PrimeFaces version 4.0, Glassfih 4.0
If you haven't read the forum rules read them now : http://forum.primefaces.org/viewtopic.php?f=3&t=1194


Posts: 7
Thanks friend for your quick response but could help a little but given that I am very new to this and my code is that I need to leave the filter ok as it was before, attached code

<p:dataTable id="eventsOverTimeExecuted" var="eventOverTimeExecuted" value="#{findEventsExecutedAdminManagedBean.eventsOverTimeExecutedAdminDataModel}"
                             paginator="true" rows="10" 
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
                             rowsPerPageTemplate="5,10,15" style="font-size: 12px" >  > 

                    <p:column headerText="Estado"  style="width:24%" filterBy="#{eventOverTimeExecuted.idstate.state}"> 
                        <h:outputText id="stateOverTime" value="#{eventOverTimeExecuted.idstate.state}" />
                        <p:tooltip for="stateOverTime" value="#{eventOverTimeExecuted.comments}" showEffect="clip" hideEffect="explode" /> 
                    </p:column>                 
                    <p:column headerText="Motivo"  style="width:24%" filterBy="#{eventOverTimeExecuted.ideventype.eventname}"> 
                        <h:outputText value="#{eventOverTimeExecuted.ideventype.eventname}" /> 
                    </p:column>                 
                    <p:column headerText="No. Cedula" style="width:24%" filterBy="#{eventOverTimeExecuted.idperson.code}"> 
                        <h:outputText value="#{eventOverTimeExecuted.idperson.code}" /> 
                    </p:column> 
                    <p:column headerText="Nombres y Apellidos" style="width:24%" filterBy="#{eventOverTimeExecuted.idperson.name}"> 
                        <h:outputText value="#{eventOverTimeExecuted.idperson.name}" /> 
                    </p:column> 
                    <p:column headerText="Ciudad" filterBy="#{findEventsExecutedAdminManagedBean.listOrganizationFather(eventOverTimeExecuted.idorganization)}">   
                        #{findEventsExecutedAdminManagedBean.listOrganizationFather(eventOverTimeExecuted.idorganization)}
                    </p:column>   
                    <p:column headerText="CC Sede" filterBy="#{eventOverTimeExecuted.idorganization.organizationame}">   
                        <h:outputText value="#{eventOverTimeExecuted.idorganization.organizationame}"/> 
                    </p:column> 
                    <p:column headerText="Cargo" style="width:24%" filterBy="#{eventOverTimeExecuted.idperson.idposition.positionname}"> 
                        <h:outputText value="#{eventOverTimeExecuted.idperson.idposition.positionname}" /> 
                    </p:column>
                    <p:column headerText="Periodo" filterBy="#{eventOverTimeExecuted.mountovertime.lapsename}">
                        <h:outputText value="#{eventOverTimeExecuted.mountovertime.lapsename}"/> 
                    </p:column> 
                    <p:column headerText="Horas" filterBy="#{eventOverTimeExecuted.hours}" >
                        <h:outputText value="#{eventOverTimeExecuted.hours}"/>   
                    </p:column>   

                    <f:facet name="footer">
                        <h:commandLink style="float: right"> 
                            <p:graphicImage value="/images/csv.png" /> 
                            <p:dataExporter type="csv" target="eventsOverTimeExecuted" fileName="Horas Extras" /> 
                        </h:commandLink> 
                        <h:commandLink style="float: right"> 
                            <p:graphicImage value="/images/xml.png" /> 
                            <p:dataExporter type="xml" target="eventsOverTimeExecuted" fileName="Horas Extras" /> 
                        </h:commandLink>
                        <h:commandLink style="float: right">   
                            <p:graphicImage value="/images/pdf.png" /> 
                            <p:dataExporter type="pdf" target="eventsOverTimeExecuted" fileName="Horas Extras"/> 
                        </h:commandLink> 
                        <h:commandLink style="float: right"> 
                            <p:graphicImage value="/images/excel.png" /> 
                            <p:dataExporter type="xls" target="eventsOverTimeExecuted" fileName="Horas Extras" /> 
                        </h:commandLink> 
                        <h:outputText value="Exportar Archivo : " style="float: right"/>
                    </f:facet> 
                </p:dataTable>
Michael Bocanegra
Last edited by erenex on 06 Feb 2013, 19:33, edited 1 time in total.


Posts: 511
Location: Belgium
Hello,

First you can read the forum guidelines. One of the things is that you should put code in the [code] tags. (-> please edit your previous post)

And what has the html that you post to do with filteredValue? I don't see it. I also don't get an answer on the question of the scope of the managed bean.

Regards
Rudy
PrimeFaces version 3.5, Tomcat 7, Mojarra 2.1.13
PrimeFaces version 4.0, Glassfih 4.0
If you haven't read the forum rules read them now : http://forum.primefaces.org/viewtopic.php?f=3&t=1194


Posts: 7
I did what you asked ... please help


Posts: 68
Go here and look at the example source code
http://www.primefaces.org/showcase/ui/d ... tering.jsf

I think you're missing the filteredValue
Primefaces 3.4.2/3.5, JSF Mojarra 2.1.17, Tomcat 7.0.33
Testing with Firefox, Chrome and IE8/9/10


Posts: 7
gracias por tu respuesta sigo el ejemplo como esta en la pagina como puedes apreciar.... pero tengo mis dudas sobre si debo adicionar mas librerias diferentes al jar de primefaces 3.5?


Return to General