title: How to implement a JavaFX table with multiple TableViews and Cell Factories?
body: <p>I have a table whose list of visible items are filtered by radio buttons at the top of the table. So let's say the radio buttons are A, B, C - if A if chosen the table will only show items of type A, if B is chosen it will show only type B, etc.</p>
  
  <p>I create a separate TableView instance for each selection because the users will be interacting with these filtered values in the table and editing values etc. I have a custom cell factory for each column in my table as well because rows need to be highlighted/frozen according to user input.</p>
  
  <p>So:</p>
  
  <pre><code>for (all values A.. C) {
      createNewTableView();
  }
  
  private void createNewTableView() {
      TableView tableView = new TableView();
  
      ...
      MyCustomCellFactory customCF = new MyCustomCellFactory();
      customCF.setTableView(tableView);
      clmn1.setCellFactory(customCF);
      ...
  }
  </code></pre>
  
  <p>My problem is that when my custom cell factory fires, even through I specifically tell it which instance of table view it belongs to, the table view instance is not the correct one. It's always just the last one I created. I've verified this by checking the instance id's.</p>
  
  <p>So the question is how can I have multiple table view instances with custom cell factories and ensure that I'm always acting on the right one in my custom cell factory code?</p>
  
  <p>Thanks!</p>