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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:29:05+00:00 2026-06-11T18:29:05+00:00

I am using primefaces and JSF 2.0. I have a data table with a

  • 0

I am using primefaces and JSF 2.0. I have a data table with a delete column that looks like this.

<p:column id="Delete" headerText="Delete">
<p:commandButton icon="delete" onclick="deleteConfirmation.show()" style="align:center">
<f:setPropertyActionListener value="#{item}" target="#{controller.selectedItem}" /> </p:commandButton>

</p:column>

//Delete confirm dialog

<p:confirmDialog id="deleteConfirmDialog" message="Are you sure you want to delete?"
                header="Delete" severity="alert"
                widgetVar="deleteConfirmation">

<p:commandButton id="confirm" value="Yes"
                    update=":myList" oncomplete="deleteConfirmation.hide()"
                    actionListener="#{controller.delete}" />
                <p:commandButton id="cancel" value="No"
                    onclick="deleteConfirmation.hide()" type="button" />
            </p:confirmDialog>

Everything works great, except when i do filtering on the data table. After i filter and click delete, the selectedItem method gets the previous row in the data table( which is not part of filter result) instead of the current row.

This problem does not exist without filtering.
I am using ViewScoped scope for my controller.

Any ideas on why this is happening? This seems like a basic thing that should be supported by a data table, so i am assuming that i am doing something wrong here. Thanks for your help

  • 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-11T18:29:06+00:00Added an answer on June 11, 2026 at 6:29 pm

    Its cause you are using pf version prior to 3.4 or you are not using the newly introduced in 3.3filteredValue attribute

    This new feature was introduced cause of the following opened issue DataTable filtering problem and ActionSource Components

    Take a look at the showcase (that is using 3.4)

    DataTable – Filtering

    DataTable filtering requires filteredValue reference in backing bean, for backwards compatibility if this reference is not defined, filtering will work using view state however this is a fallback and will be removed in future releases.


    Edit

    After reading your comment

    @Daniel- Thanks for the response.But upgrading to pf 3.4 helps partially. The correct row is deleted, but the data table does not refresh after the delete. If you notice i am updating the datatable as part of delete confirmation. Thoughts?

    I got the following to say :

    Yup , its cause you probably not removing it from the list that is being referenced by the filteredValue attribute… (remove the row from that other list in case that the other list is not null) , weird solution? I think so too… Although I can understand the logic behind the idea of executing the filtered list after we are in filter mode… but still…

    take a look at the following forum thread I posted several days ago

    3.4 datatables execute of table affects filteredValue only?

    feel free to post a rely there too 🙂

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

Sidebar

Related Questions

I am using JSF 2.0 and PrimeFaces 2.2. I have a data table whose
I'm using Primefaces 3.3.1 and have question. I have p:commandButton inside p:column of p:dataTable.
I have a PrimeFaces checkbox on a JSF page that I'd like to check/uncheck
I'm using this jQuery snippet to create tooltips on some JSF primefaces elements in
I have a data table. Each row of the table has a commandButton called
I am using PrimeFaces 3.2 with JSF 2 in a glassfish 3.1.2. I have
I have a inputTextarea that I refresh using PrimeFaces' AJAX poll. When the inputTextarea
I am using Primefaces 3.2 with jsf 2 and glassfish 3.1.2. I have a
Hi there Im just learning JSF 2 using Primefaces. I have a question regarding
I am working on a simple messenger using JSF and PrimeFaces. I would like

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.