{
super(id);
add(new ComponentFeedbackPanel("messages", this));
add(new FormInputBorder("checkinDateBorder", "Check in date", new DateField("checkinDate").setRequired(true), new PropertyModel(booking, "checkinDate"), false));
add(new FormInputBorder("checkoutDateBorder", "Check out date", new DateField("checkoutDate").setRequired(true), new PropertyModel(booking, "checkoutDate"), false));
add(new FormInputBorder("bedsBorder", "Room Preference", new DropDownChoice("beds", bedOptions, new IChoiceRenderer()
{
public Object getDisplayValue(Object object)
{
return bedOptionsDisplayValues.get(((Integer) object - 1));
}
public String getIdValue(Object object, int index)
{
return object.toString();
}
}
).setRequired(true), new PropertyModel(booking, "beds")));
add(new FormInputBorder("smokingBorder", "Smoking Preference", new RadioChoice("smoking", Arrays.asList(new Boolean[] {true, false}), new IChoiceRenderer()
{
public Object getDisplayValue(Object object)
{
if (new Boolean(true).equals(object))
{
return "Smoking";
}
else
{
return "Non Smoking";
}
}
public String getIdValue(Object object, int index)
{
if (new Boolean(true).equals(object))
{
return "true";
}
else
{
return "false";
}
}
}), new PropertyModel(booking, "smoking"), false));
add(new FormInputBorder("creditCardBorder", "Credit Card #", new TextField("creditCard").setRequired(true), new PropertyModel(booking, "creditCard")));
add(new FormInputBorder("creditCardNameBorder", "Credit Card Name", new TextField("creditCardName").setRequired(true), new PropertyModel(booking, "creditCardName")));
add(new FormInputBorder("creditCardExpiryBorder", "Credit Card Expiry", new DropDownChoice("creditCardExpiryMonth", monthOptions).setRequired(true), new PropertyModel(booking, "creditCardExpiryMonth")).add(new DropDownChoice("creditCardExpiryYear", yearOptions).setRequired(true), new PropertyModel(booking, "creditCardExpiryYear")));
add(new Link("cancel")
{
@Override
@End