public String processGradebookView() { Long currentGbId = ((Gradebook) gradebookTable.getRowData()).getId(); // if instructor, we need to load all students if (isEditable()) { currentGradebook = gradebookManager.getGradebookByIdWithHeadings(currentGbId); currentGradebook.setUsernames(gradebookManager.getUsernamesInGradebook(currentGradebook)); studentMap = currentGradebook.getStudentMap(); setSelectedStudent((String) studentMap.firstKey()); return "view_student"; } // otherwise, just load what we need for the current user currentGradebook = gradebookManager.getGradebookByIdWithHeadings(currentGbId); this.userId = SessionManager.getCurrentSessionUserId(); currentStudent = gradebookManager.getStudentByGBAndUsername(currentGradebook, this.userEid); if (currentStudent != null) { currentStudent.setLastChecked(new Timestamp(new Date().getTime())); gradebookManager.updateStudent(currentStudent); currentStudent.setGradebook(currentGradebook); } return "view_grades"; }