Created
March 23, 2014 18:29
-
-
Save beranradek/9727375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final FormMapping<RegDate> regDateMapping = | |
Forms.basic(RegDate.class, "regDate").fields("month", "year").build(); | |
private static final FormMapping<Registration> registrationForm = | |
Forms.basic(Registration.class, "registration") | |
// whitelist of properties to bind | |
.fields("attendanceReasons", "cv", "interests", "email") | |
.nested(Forms.automatic(UploadedFileWrapper.class, "certificates", | |
null, MappingType.LIST).build()) | |
.nested(Forms.basic(Address.class, "contactAddress", | |
Forms.factoryMethod(Address.class, "getInstance")) | |
.fields("street", "city", "zipCode").build()) | |
.nested(Forms.basic(Collegue.class, "collegues", | |
null, MappingType.LIST) | |
.fields("name", "email") | |
.nested(regDateMapping) | |
.build()) | |
.nested(Forms.basic(NewCollegue.class, "newCollegue") | |
.fields("name", "email") | |
.nested(regDateMapping) | |
.build()) | |
.build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment