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

  • SEARCH
  • Home
  • 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 8043939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:04:19+00:00 2026-06-05T05:04:19+00:00

Using the PrimeFaces Demo filtering DataTable ( https://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml ) as an example, I would

  • 0

Using the PrimeFaces Demo filtering DataTable (https://www.primefaces.org/showcase/ui/data/datatable/filter.xhtml) as an example, I would like to be able to provide “filtering” links outside of the table for the user to click (say Volvo, Forw, BMW, etc). When the user clicks the link, I would like to switch the selected item in the manufacturer filter dropdown and apply the filter. I haven’t been able to figure out how to get to the filter properties to make the change. Can this be done via javascript? How do I access the selection list and set the current selection?

UPDATE:
Following Daniel’s link, I managed to get the dropdown selection to change, but I am unable to get the filter to apply. In the columns where the filters are based on an input field, triggering the keyup causes the data to filter but I can’t figure out what event to trigger on the select to make it filter. Here is the code I am using:

<p:commandLink id="filterLink" 
    value="Click to filter to Volvo Only" 
    onclick="$('#carForm\\:dataTable\\:manufacturerColumn_filter').val('Volvo'),
        $('#carForm\\:dataTable\\:manufacturerColumn_filter').trigger('filter')"
/>

The link created by the above will switch the Manufacturer filter to Volvo but will not cause the data to filter.

  • 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-05T05:04:20+00:00Added an answer on June 5, 2026 at 5:04 am

    The key is to call the filter event at the table level. So my code above should properly be:

    <p:commandLink id="filterLink" 
    value="Click to filter to Volvo Only" 
    onclick="$('#carForm\\:dataTable\\:manufacturerColumn_filter').val('Volvo'), carsTable.filter()"
    />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using primefaces datatable to show some data and I would like to
I'm trying to filter a dataTable using Primefaces much like this example . (In
I am using Eclipse to work with PrimeFaces like this: <ui:composition xmlns=http://www.w3.org/1999/xhtml xmlns:ui=http://java.sun.com/jsf/facelets xmlns:h=http://java.sun.com/jsf/html
I am working on a simple messenger using JSF and PrimeFaces. I would like
I am using the dataTable object of primefaces to display some data and I
I am using primefaces 3.2. I've got the following situation: <h:form id=someForm> .. <p:dataTable
I am using Primefaces and JSF2 . All my .xhtml files are dumped in
I am using PrimeFaces 2.1 to show a dialog like this: <p:dialog header=Test modal=true
I'm using primefaces and jstl to loop a datatable.I have a List in backing
We are using Primefaces 3M4 and one of our pages has a p:dataTable which

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.