protected void buttonPressed(int buttonId) {
if (buttonId == OK) {
if (!occurrenceText.getText().equals("")){
if(occurrenceGroup == null){
try {
system.execute(new AddOccurrenceToStudent(studentId, system.getLogged(), new GDDate(), occurrenceText.getText()));
} catch (TransactionDateException e) {
setErrorMessage(MessageConstants.TRANSACTION_DATE_EXCEPTION);
} catch (Exception e) {
e.printStackTrace();
}