add(users.setOutputMarkupId(true));
add(new AjaxButton("add", Model.of(WebSession.getString(175L))) {
private static final long serialVersionUID = 5553555064487161840L;
protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) {
UsersDao userDao = Application.getBean(UsersDao.class);
for (User u : usersToAdd) {
List<Organisation_Users> orgUsers = u.getOrganisation_users();
boolean found = false;
for (Organisation_Users ou : orgUsers) {
if (ou.getOrganisation().getOrganisation_id().equals(organisation.getOrganisation_id())) {
found = true;
break;
}
}
if (!found) {
Organisation_Users orgUser = new Organisation_Users(organisation);
orgUser.setDeleted(false);
orgUsers.add(orgUser);
userDao.update(u, WebSession.getUserId());
}
}
target.appendJavaScript("$('#addUsers').dialog('close');");
groupForm.updateView(target);
}