Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Item providers get reference items as context. I.e. Applied to the contact address example, an address editor from the example upon data binding will get the root contact node so that it would be trivial to resolve the corresponding sub-node, if needed. Forms are always populated and persisted from top of the hierarchy to the bottom.

Typically, item providers are executed only twice:

  • When fetching data Item providers kick in the form life cycle only twice (typically): when the data is fetched from the back-end (to populate the a form) and when the .
  • When some updated data needs to be flushed from the Vaadin components back to the back-end (on a form commit).

Last but not least, item providers yield items wrapped into the Optional container, so it is fine not to return anything from the item provider implementation

...

. In this case, however, the form data may not be populated or saved back to the back-end

...

.

Main advantages

Item providers represent a much simpler solution than the 5 UI field transformers.

...