fc = new RequiredTextField("name");
fc.add(StringValidator.minimumLength(4));
fc.setLabel(new ResourceModel("label.name"));
form.add(fc);
form.add(new SimpleFormComponentLabel("name-label", fc));
fc = new RequiredTextField("email");
fc.add(EmailAddressValidator.getInstance());
fc.setLabel(new ResourceModel("label.email"));
form.add(fc);
form.add(new SimpleFormComponentLabel("email-label", fc));
// attach an ajax validation behavior to all form component's onkeydown
// event and throttle it down to once per second
AjaxFormValidatingBehavior.addToAllFormComponents(form, "onkeyup",