It's my first time ever using this site as well as javafx so I'll just get straight to it.
I have a tableview created in xml with an id "productTable" located within the file "test.fxml" and I have a button that is meant to populate the tableview so I have a controller that is linked to the button. So when my button is pressed it sends my event handler a ActionEvent object. The problem is that since I have the tableview created in FXML I do not have a reference to it in code. I'd like to be able to do something like:
private void handleButtonAction(ActionEvent event) {
String buttonId = ((Button)event.getSource()).getId();
//What I want to do/get
TableView table = FXMLLoader.load(getClass().getResourceById("test.fxml", "productTable"))
}
To get a reference to my table via a variable in the code.