JDK-8102348 : TableViewSelectionModel.getSelectedIndices() returns duplicates when cell selection enabled
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 7u15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-03-29
  • Updated: 2021-05-26
  • Resolved: 2013-04-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Relates :  
Description
When cellSelectionEnabled is true, and multiple cells in a single row are selected, the List returned from getSelectedIndices() will contain an index for each selected cell, not row.

Thus, for instance, if I have a single cell selected in the first row, and three cells selected in the second row, the List returned will be [0, 1, 1, 1]. I would only expect to find [0, 1]. Per cell selection queries should use getSelectedCells().

getSelectedItems() also displays this behavior.
Comments
Unit tests developed for TableView and TreeTableView. Will develop a fix ASAP. Thanks for the bug report!
08-04-2013