This discussion is archived
2 Replies Latest reply: Jan 28, 2013 9:27 AM by sselvia RSS

TableView cellfactory set style based on content from another cell

sselvia Newbie
Currently Being Moderated
I'm trying to figure out how to set the color of the current cell based on the content from another cell or property in the class that contains the row content. I looked at the following thinking I can use this but the table position method is not longer there.

((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).setLastName(t.getNewValue()); // from a oracle tableview javafx example

I would like to:

if (((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).getRowError())
{
cell.setStyle("..."); // Set the color of the cell content
}

Is there away to get the underlying object from the setcellfactory call method?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points