protected void commitAndClose() {
if (delegate.isModified()) {
if (!validateAll()) return;
try {
userProfile.updateProfile(userDs.getItem());
} catch (ValidationException e) {
showNotification(e.getLocalizedMessage(), NotificationType.ERROR);
return;
}
User newUser = userProfile.getProfile();
userDs.setItem(newUser);
UserSession userSession = userSessionSource.getUserSession();
userSession.setUser(newUser);
pushUserSessionUpdate(userSession);
showNotification(getMessage("profile.commitSuccess"), NotificationType.HUMANIZED);
}
close(COMMIT_ACTION_ID);
}