Now we have to make the view cooperate with the model. To do this, we must add items to the StudentEditController class (since this is the controller for our view).
Add an @FXML reference to the widgets you added for class standing. This is how you will pull data out of the widget to pass to the model. Be sure the spelling for the fxid matches what is in the .fxml file exactly.
Edit the initialize method to handle any start up code you need. If you used a combobox like me, this is where you will populate the box with the different classes (Freshman, etc). Remember that calling values() on an enum will give you an array. You will need to wrap this in an ObservableList. I made a static helper function that did that for me in the model.
Edit the setStudent method to set your widget to a default value
Edit the OK button press to pull the information out of your new widget and put into the student instance.
If you used a free text entry field, you will need to edit the isInputValid method to check that a valid class was entered. If you used a constrained widget like radio buttons or combo box where it is impossible to enter a bad value, then you do not have to do any validation.
Now run the app. You should be able to enter new students and their standing and see it reflected in the UI. if not, then check your code through the complete stack. Are you calling the setters in the model to update the information? Are you pulling the information out of the widget correctly?
Now we have to make the view cooperate with the model. To do this, we must add items to the StudentEditController class (since this is the controller for our view).
Now run the app. You should be able to enter new students and their standing and see it reflected in the UI. if not, then check your code through the complete stack. Are you calling the setters in the model to update the information? Are you pulling the information out of the widget correctly?