question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datatable: Row remains selected after clearing backing bean

See original GitHub issue

Describe the defect Basic datatable with single selection: when a row is selected and an action that clears the backing bean selected row object is executed, the row remains selected in the browser.

This only happens when the datatable has declared the “rowSelect” event.

Reproducer Run the attached project (mvn jetty:run) and visit http://localhost:8080/primefaces-test/. Then select a row and click “Unselect row” button. The row remains selected in the browser.

It works fine (the row is no longer selected) if you comment out the following line in test.xhtml:

<p:ajax event="rowSelect" listener="#{testView.onSelectProduct}" />

Environment:

  • PF Version: 10.0.x
  • JSF + version: Mojarra 2.2.20 and MyFaces 2.3.9
  • Affected browsers: ALL

primefaces-test-master.zip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
doteo78commented, Aug 19, 2021

Working properly with version 10.0.6. Thanks!

1reaction
mellowarecommented, Jun 10, 2021

Figured it out. Thanks for the reproducer helping me debug it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set selected row from backing bean in primefaces datatable
I am using primefaces datatable with clickable rows and I need to find way how to set selected row from backing bean. ......
Read more >
[solved] deleting DataTable row via button in the same row
Hi all! I am trying to create simple CRUD table with button "edit" and "delete" at every data row. Completely stuck with the...
Read more >
Refresh a table of data after inserting or deleting a row using ...
Select a row from a table of data, click a button to delete the row, and remain on the same page. The table...
Read more >
row().remove() - DataTables
row ().remove(). Since: DataTables 1.10. Delete the selected row from the DataTable. Description. This method (and its plural counterpart, ...
Read more >
About request scope and removing a row from datatable
If the client clicks on a commandButton or commandLink on a row in the dataTable, the form request is then sent back to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found