Reputation: 2674
I am trying to apply filter on my datatable but i don't why it is not working.I have checked all the things again and again but still it is not working and even not showing any error or exception.Here is my code
page.xhtml
<p:dataTable id="masterResult" value="#{masterSearch.masterSearchResultList}" var="srvc"
styleClass="display" style="cursor:pointer;" rows="6"
paginator="true" rowsPerPageTemplate="5,10,15" paginatorAlwaysVisible="false" paginatorPosition="bottom"
widgetVar="viewTable" filteredValue="#{masterSearch.filterMasterSearchResult}">
<p:column filterBy="#{srvc.serviceNumber}"
headerText="Service Number"
filterMatchMode="endsWith">
<h:outputText value="#{srvc.serviceNumber}"/>
</p:column>
<p:column headerText="Rank">
#{srvc.rank}
</p:column>
<p:column headerText="Name">
#{srvc.name}
</p:column>
<p:column headerText="Course">
#{srvc.course}
</p:column>
<p:column headerText="Unit">
#{srvc.unit}
</p:column>
<p:column headerText="Relation">
#{srvc.relation}
</p:column>
</p:dataTable>
Here I am getting the values properly but when I write anthing in filter text field (showed by primefaces)it won't work.
Please help if anyone get idea about this
Thanks
public class MasterSearch {
String serviceNumber;
String rank;
String fullName;
String CNICNumber;
String phoneNumber;
String emailAddress;
List<MasterSearchResult> masterSearchResultList;
List<MasterSearchResult> filterMasterSearchResult;
// getter
// setters
Upvotes: 1
Views: 1426
Reputation: 4406
Remove this part : filteredValue="#{masterSearch.filterMasterSearchResult}"
check my sample from here : https://dl.dropbox.com/s/v3ihl25aozt8qyn/mavenproject.zip?dl=1
Upvotes: 2