found = true;
break;
}
}
if (!found) {
RoomModerator rm = new RoomModerator();
rm.setRoomId(r.getRooms_id());
rm.setUser(u);
r.getModerators().add(0, rm);
moderator2add.setObject(null);
target.add(moderatorContainer, moderatorChoice);
}
}
}
}).setOutputMarkupId(true));
add(moderatorContainer.add(new ListView<RoomModerator>("moderators") {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<RoomModerator> item) {
RoomModerator moderator = item.getModelObject();
Label name = new Label("uName", moderator.getUser().getFirstname() + " " + moderator.getUser().getLastname());
if (moderator.getRoomModeratorsId() == 0) {
name.add(AttributeAppender.append("class", "newItem"));
}
item.add(new CheckBox("isSuperModerator", new PropertyModel<Boolean>(moderator, "isSuperModerator")))
.add(new Label("userId", "" + moderator.getUser().getUser_id()))
.add(name)
.add(new Label("email", moderator.getUser().getAdresses().getEmail()))
.add(new WebMarkupContainer("delete").add(new AjaxEventBehavior("onclick"){
private static final long serialVersionUID = 1L;
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {