// TODO (after ERRAI-366): make this method package-private
@EventHandler("saveButton")
public void onSaveButtonClicked(ClickEvent event) {
Department resolvedDepartment = Department.resolve(em, department.getText());
Item item = itemBinder.getModel();
item.setDepartment(resolvedDepartment);
item.setAddedBy(user);
item.setAddedOn(new Date());
final Set<ConstraintViolation<Item>> violations = validator.validate(item);
if (violations.size() > 0) {
ConstraintViolation<Item> violation = violations.iterator().next();
overallErrorMessage.setText(violation.getPropertyPath() + " " + violation.getMessage());