Versions Compared

Key

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

...

  • Use a contact's child node to store the data, in which case an item provider that resolves a sub-node can be used.
  • Store the properties directly on the contact node and keep it flat (self-reference item provider use case).

item Item providers get reference items as context. I.e. 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.

  • Item providers kick in the form lifecycle life cycle only twice (typically): when the data is fetched from the backend back-end (to populate the form) and when the updated data needs to be flushed from the Vaadin components back to the backend back-end (on form commit).
  • item providers yield items wrapped into Optional container, so it is fine not to return anything from the item provider implementation (in such case though, the form data may not be populated or saved back to the backendback-end).

Main advantages

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

...