private static final long serialVersionUID = 1L;
@Bindable protected Form form = new Form();
public RegexDemo() {
RegexField versionField = new RegexField("version", "Version", 10);
versionField.setPattern("[0-9]+\\.[0-9]+\\.[0-9]+");
versionField.setRequired(true);
versionField.setTitle("Version number, e.g. '1.2.0'");
form.add(versionField);
RegexField urlField = new RegexField("url", "URL", 30);
urlField.setPattern("(http|https)://.+");
urlField.setRequired(true);
urlField.setTitle("URL address, e.g. 'http://www.google.com'");
form.add(urlField);
form.add(new Submit("submit", " OK "));
form.add(new PageSubmit("cancel", HomePage.class));;
}