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 9161091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:53:25+00:00 2026-06-17T13:53:25+00:00

Okay. So I’m trying to implement a global filter using commandLinks. The idea is

  • 0

Okay. So I’m trying to implement a global filter using commandLinks. The idea is to have an alphabet of commandLinks, which a user can then use instead of typing a letter.

So far, I’ve got filtering working on the column (will add the filterStyle none once the commandLinks are working).

Using chromes debug tool (ctrl-shift+i), and clicking on the command link, i can see the datatable refresh the list. However, it doesn’t filter anything.

I’ve been using primefaces showcase, and this stack overflow post to base my code on, which is below:

 <p:dataTable id="availableSpecies" var="species" value="#{bbWizardBean.speciesPaletteList}"
                                    emptyMessage="Add First Species" dynamic="true"
                                    width="120"
                                    widgetVar="speciesPaletteVar"
                                    scrollHeight="250" scrollRows="20" scrollable="true"
                                    styleClass="width-fix-spcPal-ie" style="width:150px; margin-left: auto; margin-right: auto;"
                                    filteredValue="bbWizardBean.speciesPaletteListFilter">

        <f:facet name="header">
                            <h:outputText value="Species Palette" />
                            <p:commandLink id="globalFilter" value="A" onclick="$('speciesColumn_filter').val('A'),speciesPaletteVar.filter()"/>
        </f:facet>
        <p:column filterBy="#{species.speciesName}"
                                    headerText="Species" style="font-size:13px;" id="speciesColumn">
            <h:outputText id="dragIcon" value="#{species.speciesNameSmall}" style="font-size:11px; background-color:silver; cursor:move;"/>
            <h:outputText id="dragIconTooltip" value="..." title="Full Name: #{species.speciesName}" rendered="#{species.speciesNameLength > 10}"/>
            <p:tooltip for="dragIconTooltip" />

                            <p:draggable for="dragIcon" revert="true" />
        </p:column>

I’ve removed the rest of the table to make the codebase smaller. I think I’m screwing up the value I should set, but I’m not quite sure how. Any help would be appreciated! First post, so any suggestions to clean up the question is appreciate 😉

  • 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-17T13:53:26+00:00Added an answer on June 17, 2026 at 1:53 pm

    Okay, so for some reason (like i thought), the setting of the val for the filter wasn’t working right. You need to add two \’s before the : for some reason. If anyone knows, that would be awesome, but the correct code is:

    <p:commandLink id="globalFilter" value="A" onclick="$('#positiveRegulationForm\\:availableSpecies\\:speciesColumn_filter').val('A'),speciesPaletteVar.filter()"/>
    

    Where
    positiveRegulationForm is the top form
    availableSpecies is the DataTable name
    speciesColumn_filter is the filter for the column speciesColumn

    Really curious as to why you need the two forward slashes

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

Sidebar

Related Questions

okay, i'm setting up a multi-user chat system. i have a messages table, that
Okay, so I have created a user table inside of my database to hold
Okay I've been trying to research how to do this and have failed. I
Okay so I can't figure this out. Like a file that I using grep
Okay, so i'm trying to give 7 different labels names using an array and
Okay so this one is stumping me. I have the following code which attempts
Okay so I am trying to port my Android app that is currently using
Okay, next PHPExcel question. I have an HTML form that users fill out and
Okay this question is very simple: I have a facebook page, and a website.
Okay, I have the following create action #posts_controller, nested resource under discussions def create

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.