Auto Forms
Server-side addon for quick creation of forms from POJOs using annotations
Annotate your POJO's with several simple annotations and this add-on will build the complete multi-column form from it automatically.
- Server-side only add-on, no widgetset update required
- Create forms with zero widget/layout java/xml code
- Describe form details and layouting in your POJO as extra annotations
- Use IDE code completion benefits
- Extra fast forms creation (1-2 mins per form)
P.S. Note, that this add-on is in pre-alpha experimental state. No documentation exists at the moment.
P.S.2. As for now, add-on supports simple form fields only. For the 1.0 release it is planned to add support for both simple and nested forms (complex POJO's), multi-page forms, support for custom validation methods in POJO's and several more features, so stay tuned.
Sample code
@FormBean(rows = 4, columns = 2, cancelButtonVisible = false, commitButtonVisible = false, title = "???????????", header = "?? ?? ????? ???????? ??? ??????? ????????????. ??????? ??? ??? ?????, ????? ??????????? ????? ? ?????????? ??????. ??? ????????? ??????, ????? ??? ?????? ????????, ?????????? ???????? ? ?????? ?? ??????? ????????? ? ????? ??????? ????? ? ?????? ????????.") public class SignupForm implements Serializable { @FormField(title = "Your name", location = "0,0,1,0", required = true, requiredFieldErrorMessage = "Please enter your name") private String name; @FormField(title = "E-Mail", location = "0,1,1,1", required = true, requiredFieldErrorMessage = "Please enter your e-mail") private String email = "a@b.c"; @FormField(title = "Date of birth", location = "0,2,1,2", requiredFieldErrorMessage = "Please indicate your date of birth") @DateTypeOptions(resulution = Resolution.MONTH, format = "dd.MM.yyyy") private long birthDate; @FormField(title = "Create new password", location = "0,3", required = true, requiredFieldErrorMessage = "Please create and type your new password") private String password1; @FormField(title = "Type your password again", location = "1,3", required = true, requiredFieldErrorMessage = "Retype your password once again for verification") private String password2; public SignupForm() { } // getter and setters skipped... }
AutoForm form = new AutoForm(); myWindowLayout.addComponent(form); SignupForm data = new SignupForm(); form.setFormData(data);
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Initial pre-alpha build
- Released
- 2013-07-28
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 7.0+
- Browser
- Browser Independent