package org.wicketTutorial.jsr303validation;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.wicketTutorial.jsr303validation.jsr303.Person;
import org.apache.wicket.bean.validation.PropertyValidator;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.wicketTutorial.commons.bootstrap.layout.BootstrapBasePage;
import org.apache.wicket.model.CompoundPropertyModel;
public class HomePage extends BootstrapBasePage {
private static final long serialVersionUID = 1L;
public HomePage(final PageParameters parameters) {
super(parameters);
setDefaultModel(new CompoundPropertyModel<Person>(new Person()));
Form<Void> form = new Form<Void>("form");
form.add(new TextField("name").add(new PropertyValidator()));
form.add(new TextField("email").add(new PropertyValidator()));
form.add(new TextField("age").add(new PropertyValidator()));
form.add(new TextField("birthDay").add(new PropertyValidator()));
form.add(new TextField("address.city").add(new PropertyValidator()));
form.add(new TextField("address.street").add(new PropertyValidator()));
form.add(new TextField("address.zipCode").add(new PropertyValidator()));
form.add(new FeedbackPanel("feedback"));
add(form);
}
}