Skip to content

Instantly share code, notes, and snippets.

@beranradek
Created March 23, 2014 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beranradek/9727375 to your computer and use it in GitHub Desktop.
Save beranradek/9727375 to your computer and use it in GitHub Desktop.
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