KrailOrg / krail

Rapid web app framework using Vaadin 8 integrated with Guice and Shiro
50 stars 18 forks source link

Forms support #642

Open davidsowerby opened 7 years ago

davidsowerby commented 7 years ago

Vaadin 8 made some improvements to Form support, primarily with the Binder class, but there is opportunity to extend that further.

Substantial changes would be needed, however. First thoughts on design ...

The binder and related actors should:

  1. scan an entity for all the annotations above to produce a property descriptor
  2. optionally cache the descriptor 1. it may be used many times
  3. bind the Field to the entity property as Binder does now
  4. set Field locale to CurrentLocale
  5. set Field size, where appropriate, according to property type and validation (for example maxLength on String or max on Integer affect required field length
  6. automatically select the appropriate Vaadin Field for the property data type, with an option to override the default selection with a Presentation annotation
  7. ensure all presentation elements are updated in response to a Locale change
  8. fully integrate Validation, I18N and presentation elements
  9. enable the addition of new Validators as required
  10. maybe use external standard data converters instead of Vaadin specific (perhaps Apache Commons Convert)
  11. enable the addition of custom data converters as required, preferably though Guice

An entity should:

Major changes:

davidsowerby commented 6 years ago

Build this on top of easyBinder

mcollovati commented 6 years ago

Apache BVal team seems to be working on implementing Java Bean Validation 2.0 http://bval.apache.org/board-reports/2018-03.html#activity

There is also a dedicate branch on github repository https://github.com/apache/bval/tree/bv2