2 Replies Latest reply: Jan 28, 2013 11:27 AM by sselvia RSS

    TableView cellfactory set style based on content from another cell

    sselvia
      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?