Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:31:50+00:00 2026-06-05T01:31:50+00:00

I have a column in a datatable and I want to add a filter

  • 0

I have a column in a datatable and I want to add a filter with this code:

<p:dataTable id="aDataTable" var="aVariable" value="#{aView.values}" paginator="true" rows="10" selectionMode="single" selection="#{aView.selection}" onRowSelectUpdate="aForm">
                 <f:facet name="header">
                     A List
                 </f:facet>
              <p:column sortBy="#{aVariable.id}" filterBy="#{aVariable.id}" filterEvent="change">
                  <f:facet name="header">
                      <h:outputText value="No"/>
                  </f:facet>
                   <h:outputText value="#{aVariable.id}"/>
              </p:column>
              <p:column sortBy="#{aVariable.date}" filterBy="#{aVariable.date}" filterEvent="change">
                  <f:facet name="header">
                      <h:outputText value="Date"/>
                  </f:facet>
</p:dataTable>

date is inputted in a form in this format:

<h:outputText value="Date: *"/>
<p:calendar pattern="dd/MM/yyyy" value="#{aView.value.date}"/>

Filter is working for id but not for date. What is the reason for this and how can I make filter work in this case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:31:51+00:00Added an answer on June 5, 2026 at 1:31 am

    There is no ready-made date filter mechanism in primefaces yet, but there is a possibility to filter by date using a custom filter. You will have to define a header facet for your column and use ajax calls for “manual” filtering, but it does work:

    <column>
      <f:facet name="header">DateRange
        <div>
          <p:calendar id="from" value="#{bean.from}" styleClass="calendarFilter">
            <p:ajax event="dateSelect" listener="#{ctrlr.filterDates()}" update="dataTableId"/>
          </p:calendar>
          <p:calendar id="to" value="#{bean.to}" styleClass="calendarFilter">
            <p:ajax event="dateSelect" listener="#{ctrlr.filterDates()}" update="dataTableId"/>
          </p:calendar>
        </div>
      </f:facet>
    

    …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have retrived this datatable from datasource and i want to add a more
How to filter DataView/DataTable by time? I have a table with datetime column inside
i have a DataTable that has a column (Profit). What i want is to
I have write this code to create a gridview with 3 columns DataTable dt
I have a datatable binded with gridview and I want to change the column
I have a <ice:dataTable> and I want to add a checkbox to each row.
I have a Datatable that contains a column that I want to use for
I have DataTable with two columns Author and Bookname . I want to check
I have datatable with column name tag and 100 rows of data.I need to
I have to select specific column from my DataTable using linq I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.