PranovD / CS2340

MIT License
0 stars 0 forks source link

M3 - Make view work with model #13

Open adang96 opened 7 years ago

adang96 commented 7 years ago

Now we have to make the view cooperate with the model. To do this, we must add items to the EditStudentActivity class (since this is the controller for our view).

Add a 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. Edit the onCreate method to handle any start up code you need. If you used a spinner like me, this is where you will populate the box with the different classes (Freshman, etc). You can look at my spinner for selecting majors to get an idea how to do this. Edit the Add 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 validate the class standing (check it is one of four correct values). If you used a constrained widget like radio buttons or spinner 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?