add(new RequiredTextField<String>("appointmentName"));
add(new TextArea<String>("appointmentDescription"));
add(new TextField<String>("appointmentLocation"));
add(new DateTimeField("appointmentStarttime"));
add(new DateTimeField("appointmentEndtime"));
final PasswordTextField pwd = new PasswordTextField("password");
pwd.setEnabled(isPwdProtected());
pwd.setOutputMarkupId(true);
add(pwd);
add(new DropDownChoice<AppointmentReminderTyps>(
"remind"
, Application.getBean(AppointmentReminderTypDao.class).getAppointmentReminderTypList()
, new ChoiceRenderer<AppointmentReminderTyps>("name", "typId")));
final DropDownChoice<RoomType> roomType = new DropDownChoice<RoomType>(
"room.roomtype"
, Application.getBean(RoomManager.class).getAllRoomTypes()
, new ChoiceRenderer<RoomType>("name", "roomtypes_id"));
roomType.setEnabled(createRoom);
roomType.setOutputMarkupId(true);
add(roomType);
final DropDownChoice<Room> room = new DropDownChoice<Room>(
"room"
, getRoomList()
, new ChoiceRenderer<Room>("name", "rooms_id"));
room.setEnabled(!createRoom);
room.setOutputMarkupId(true);
add(room);
add(new AjaxCheckBox("createRoom", new PropertyModel<Boolean>(this, "createRoom")) {
private static final long serialVersionUID = -3743113990890386035L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
createRoom = getConvertedInput();
target.add(roomType.setEnabled(createRoom), room.setEnabled(!createRoom));
}
});
add(new AjaxCheckBox("isPasswordProtected") {
private static final long serialVersionUID = 6041200584296439976L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
CalendarForm.this.getModelObject().setIsPasswordProtected(getConvertedInput());
pwd.setEnabled(isPwdProtected());
target.add(pwd);
}
});
}